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

Method save_state

Lib/_pyrepl/_module_completer.py:471–478  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

469
470 @contextmanager
471 def save_state(self) -> Any:
472 try:
473 self.stack.append(self.index)
474 yield
475 except ParseError:
476 self.index = self.stack.pop()
477 else:
478 self.stack.pop()
479
480 def __bool__(self) -> bool:
481 return self.index < len(self.tokens)

Callers 2

_parseMethod · 0.80
parse_dotted_as_nameMethod · 0.80

Calls 2

appendMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected