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

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)
Override match() to insist on a leaf node.

src/p/y/py3kwarn-HEAD/py3kwarn2to3/tests/test_pytree.py   py3kwarn(Download)
        pl = pytree.LeafPattern(100, "foo", name="pl")
        r = {}
        self.assertFalse(pl.match(root, results=r))
        self.assertEqual(r, {})
        self.assertFalse(pl.match(n1, results=r))
        self.assertEqual(r, {})
        self.assertFalse(pl.match(n2, results=r))
        self.assertEqual(r, {})
        self.assertTrue(pl.match(l1, results=r))
        self.assertEqual(r, {"pl": l1})
        r = {}
        self.assertFalse(pl.match(l2, results=r))
        self.assertEqual(r, {})
        # Build a pattern matching a node