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

All Samples(5)  |  Call(3)  |  Derive(1)  |  Import(1)

src/e/r/erp5-HEAD/product/ERP5Type/patches/Restricted.py   erp5(Download)
from Acquisition import aq_acquire
from AccessControl import getSecurityManager
from AccessControl.ZopeGuards import (safe_builtins, _marker, Unauthorized,
    aq_validate, guard, guarded_getattr, guarded_iter, SafeIter, NullIter,
    ContainerAssertions, GuardedDictType, _dict_white_list)
class SafeIterItems(SafeIter):
 
    def next(self):
        ob = self._next()
        c = self.container
def guarded_reversed(seq):
    return SafeIter(reversed(seq))
safe_builtins['reversed'] = guarded_reversed
 
def guarded_enumerate(seq, start=0):

src/a/c/AccessControl-3.0.8/src/AccessControl/tests/test_safeiter.py   AccessControl(Download)
    def test_iteration(self):
        seq = [1, 2, 3]
        seqid = id(seq)
        it = ZopeGuards.SafeIter(seq)
        self.assertEqual(list(it), seq)
    def test_iteration_with_container(self):
        seq = [1, 2, 3]
        container = object()
        contid = id(container)
        it = ZopeGuards.SafeIter(seq, container)