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

All Samples(96)  |  Call(95)  |  Derive(0)  |  Import(1)
Concrete implementation for leaf nodes.

src/p/y/py3kwarn-HEAD/py3kwarn2to3/fixes/fix_set_literal.py   py3kwarn(Download)
 
        # Build the contents of the literal
        literal = [pytree.Leaf(token.LBRACE, u"{")]
        literal.extend(n.clone() for n in items.children)
        literal.append(pytree.Leaf(token.RBRACE, u"}"))

src/p/y/py3kwarn-0.4.4/py3kwarn2to3/fixes/fix_set_literal.py   py3kwarn(Download)
 
        # Build the contents of the literal
        literal = [pytree.Leaf(token.LBRACE, u"{")]
        literal.extend(n.clone() for n in items.children)
        literal.append(pytree.Leaf(token.RBRACE, u"}"))

src/p/y/py3kwarn-HEAD/py3kwarn2to3/tests/test_pytree.py   py3kwarn(Download)
        def test_deprecated_prefix_methods(self):
            l = pytree.Leaf(100, "foo")
            with warnings.catch_warnings(record=True) as w:
                warnings.simplefilter("always", DeprecationWarning)
                self.assertEqual(l.get_prefix(), "")
    def test_leaf(self):
        l1 = pytree.Leaf(100, "foo")
        self.assertEqual(l1.type, 100)
        self.assertEqual(l1.value, "foo")
 
    def test_leaf_repr(self):
        l1 = pytree.Leaf(100, "foo")
    def test_leaf_str(self):
        l1 = pytree.Leaf(100, "foo")
        self.assertEqual(str(l1), "foo")
        l2 = pytree.Leaf(100, "foo", context=(" ", (10, 1)))
        self.assertEqual(str(l2), " foo")

src/p/y/py3kwarn-HEAD/py3kwarn2to3/tests/test_util.py   py3kwarn(Download)
 
# Local imports
from py3kwarn2to3.pytree import Node, Leaf
from py3kwarn2to3 import fixer_util
from py3kwarn2to3.fixer_util import Attr, Name, Call, Comma
    def test(self):
        kids = [None,
                [Leaf(token.NUMBER, 1), Leaf(token.NUMBER, 2),
                 Leaf(token.NUMBER, 3)],
                [Leaf(token.NUMBER, 1), Leaf(token.NUMBER, 3),