MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / lazy

Method lazy

tests/test_code/py/pytz/lazy.py:96–107  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

94 fill_iter = [fill_iter]
95
96 def lazy(name):
97 def _lazy(self, *args, **kw):
98 _fill_lock.acquire()
99 try:
100 if len(fill_iter) > 0:
101 list.extend(self, fill_iter.pop())
102 for method_name in cls._props:
103 delattr(LazyList, method_name)
104 finally:
105 _fill_lock.release()
106 return getattr(list, name)(self, *args, **kw)
107 return _lazy
108
109 for name in cls._props:
110 setattr(LazyList, name, lazy(name))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected