MCPcopy Index your code
hub / github.com/nodejs/node / __init__

Method __init__

tools/inspector_protocol/jinja2/runtime.py:423–435  ·  view source on GitHub ↗
(self, iterable, undefined, recurse=None, depth0=0)

Source from the content-addressed store, hash-verified

421class LoopContext(LoopContextBase):
422
423 def __init__(self, iterable, undefined, recurse=None, depth0=0):
424 LoopContextBase.__init__(self, undefined, recurse, depth0)
425 self._iterator = iter(iterable)
426
427 # try to get the length of the iterable early. This must be done
428 # here because there are some broken iterators around where there
429 # __len__ is the number of iterations left (i'm looking at your
430 # listreverseiterator!).
431 try:
432 self._length = len(iterable)
433 except (TypeError, AttributeError):
434 self._length = None
435 self._after = self._safe_next()
436
437 @property
438 def length(self):

Callers

nothing calls this directly

Calls 2

_safe_nextMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected