MCPcopy Index your code
hub / github.com/python/cpython / cache_effect

Method cache_effect

Tools/cases_generator/parsing.py:451–462  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

449
450 @contextual
451 def cache_effect(self) -> CacheEffect | None:
452 # IDENTIFIER '/' NUMBER
453 if tkn := self.expect(lx.IDENTIFIER):
454 if self.expect(lx.DIVIDE):
455 num = self.require(lx.NUMBER).text
456 try:
457 size = int(num)
458 except ValueError:
459 raise self.make_syntax_error(f"Expected integer, got {num!r}")
460 else:
461 return CacheEffect(tkn.text, size)
462 return None
463
464 @contextual
465 def stack_effect(self) -> StackEffect | None:

Callers 1

inputMethod · 0.95

Calls 4

expectMethod · 0.95
make_syntax_errorMethod · 0.95
CacheEffectClass · 0.85
requireMethod · 0.80

Tested by

no test coverage detected