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

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Equivalent to 'node.children[i] = child'. This method also sets the
child's parent attribute appropriately.

src/p/y/py3kwarn-HEAD/py3kwarn2to3/tests/test_pytree.py   py3kwarn(Download)
 
        l2 = pytree.Leaf(100, "bar")
        n1.set_child(0, l2)
        self.assertEqual(l1.parent, None)
        self.assertEqual(l2.parent, n1)
        self.assertEqual(n1.children, [l2])
 
        n2 = pytree.Node(1000, [l1])
        n2.set_child(0, n1)