MCPcopy Create free account
hub / github.com/python/cpython / NTimesUnwrappable

Class NTimesUnwrappable

Lib/test/test_inspect/test_inspect.py:6416–6427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6414
6415
6416class NTimesUnwrappable:
6417 def __init__(self, n):
6418 self.n = n
6419 self._next = None
6420
6421 @property
6422 def __wrapped__(self):
6423 if self.n <= 0:
6424 raise Exception("Unwrapped too many times")
6425 if self._next is None:
6426 self._next = NTimesUnwrappable(self.n - 1)
6427 return self._next
6428
6429class TestUnwrap(unittest.TestCase):
6430

Callers 2

__wrapped__Method · 0.85
test_recursion_limitMethod · 0.85

Calls

no outgoing calls

Tested by 2

__wrapped__Method · 0.68
test_recursion_limitMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…