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

All Samples(12)  |  Call(6)  |  Derive(0)  |  Import(6)

        def get_iter(c, name):
    iter = getattr(c, name)
    def guarded_iter():
        return SafeIter(iter(), c)
    return guarded_iter
        


src/a/c/AccessControl-3.0.8/src/AccessControl/tests/testZopeGuards.py   AccessControl(Download)
        def test_iterkeys_simple(self):
            from AccessControl.ZopeGuards import get_iter
            d = {'foo':1, 'bar':2, 'baz':3}
            iterkeys = get_iter(d, 'iterkeys')
            keys = d.keys()
        def test_iterkeys_empty(self):
            from AccessControl.ZopeGuards import get_iter
            iterkeys = get_iter({}, 'iterkeys')
            self.assertEqual(list(iterkeys()), [])
 
        def test_iterkeys_validates(self):
            from AccessControl.ZopeGuards import get_iter