MCPcopy Index your code
hub / github.com/python/mypy / pop_frame

Method pop_frame

mypy/binder.py:427–448  ·  view source on GitHub ↗

Pop a frame and return it. See frame_context() for documentation of fall_through and discard.

(self, can_skip: bool, fall_through: int, *, discard: bool = False)

Source from the content-addressed store, hash-verified

425 return changed
426
427 def pop_frame(self, can_skip: bool, fall_through: int, *, discard: bool = False) -> Frame:
428 """Pop a frame and return it.
429
430 See frame_context() for documentation of fall_through and discard.
431 """
432
433 if fall_through > 0:
434 self.allow_jump(-fall_through)
435
436 result = self.frames.pop()
437 options = self.options_on_return.pop()
438
439 if discard:
440 self.last_pop_changed = False
441 return result
442
443 if can_skip:
444 options.insert(0, self.frames[-1])
445
446 self.last_pop_changed = self.update_from_options(options)
447
448 return result
449
450 @contextmanager
451 def accumulate_type_assignments(self) -> Iterator[Assigns]:

Callers 3

top_frame_contextMethod · 0.95
check_func_defMethod · 0.80
__exit__Method · 0.80

Calls 4

allow_jumpMethod · 0.95
update_from_optionsMethod · 0.95
insertMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected