Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(12)  |  Call(7)  |  Derive(0)  |  Import(5)
A comma leaf

        def Comma():
    """A comma leaf"""
    return Leaf(token.COMMA, u",")
        


src/p/y/py3kwarn-HEAD/py3kwarn2to3/fixes/fix_urllib.py   py3kwarn(Download)
# Local imports
from py3kwarn2to3.fixes.fix_imports import alternates, FixImports
from py3kwarn2to3.fixer_util import (Name, Comma, FromImport, Newline,
                                find_indentation, Node, syms)
 
        # create a Node list of the replacement modules
        for name in MAPPING[import_mod.value][:-1]:
            names.extend([Name(name[0], prefix=pref), Comma()])
        names.append(Name(MAPPING[import_mod.value][-1][0], prefix=pref))
        import_mod.replace(names)
                for elt in elts[:-1]:
                    names.extend(handle_name(elt, pref))
                    names.append(Comma())
                names.extend(handle_name(elts[-1], pref))
                new = FromImport(module, names)

src/p/y/py3kwarn-0.4.4/py3kwarn2to3/fixes/fix_urllib.py   py3kwarn(Download)
# Local imports
from py3kwarn2to3.fixes.fix_imports import alternates, FixImports
from py3kwarn2to3.fixer_util import (Name, Comma, FromImport, Newline,
                                find_indentation, Node, syms)
 
        # create a Node list of the replacement modules
        for name in MAPPING[import_mod.value][:-1]:
            names.extend([Name(name[0], prefix=pref), Comma()])
        names.append(Name(MAPPING[import_mod.value][-1][0], prefix=pref))
        import_mod.replace(names)
                for elt in elts[:-1]:
                    names.extend(handle_name(elt, pref))
                    names.append(Comma())
                names.extend(handle_name(elts[-1], pref))
                new = FromImport(module, names)

src/p/y/py3kwarn-HEAD/py3kwarn2to3/fixes/fix_exitfunc.py   py3kwarn(Download)
 
from py3kwarn2to3 import pytree, fixer_base
from py3kwarn2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
 
 
        names = self.sys_import.children[1]
        if names.type == syms.dotted_as_names:
            names.append_child(Comma())
            names.append_child(Name(u"atexit", u" "))
        else:

src/p/y/py3kwarn-0.4.4/py3kwarn2to3/fixes/fix_exitfunc.py   py3kwarn(Download)
 
from py3kwarn2to3 import pytree, fixer_base
from py3kwarn2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
 
 
        names = self.sys_import.children[1]
        if names.type == syms.dotted_as_names:
            names.append_child(Comma())
            names.append_child(Name(u"atexit", u" "))
        else:

src/p/y/py3kwarn-HEAD/py3kwarn2to3/tests/test_util.py   py3kwarn(Download)
from py3kwarn2to3.pytree import Node, Leaf
from py3kwarn2to3 import fixer_util
from py3kwarn2to3.fixer_util import Attr, Name, Call, Comma
from py3kwarn2to3.pgen2 import token
 
            for arg in args:
                children.append(arg)
                children.append(Comma())
            children.pop()
        return Call(Name(name), children, prefix)