Skip to content

Commit 9d14b23

Browse files
committed
Comment explaining the frame_context() function.
1 parent 5eab5ed commit 9d14b23

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mypy/checker.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ def pop_loop_frame(self) -> None:
340340

341341
def frame_context(self, fall_through: bool = False,
342342
clear_breaking: bool = False) -> 'FrameContextManager':
343+
"""Return a context manager that pushes/pops frames on enter/exit.
344+
345+
If fall_through, then allow types to escape from the inner
346+
frame to the resulting frame. That is, the state of types at
347+
the end of the last frame are allowed to fall through into the
348+
enclosing frame.
349+
350+
If clear_breaking, then on __exit__ the manager will clear the
351+
breaking_out flag, and if it was not set, will allow the frame
352+
to escape to its grandparent.
353+
"""
343354
return FrameContextManager(self, fall_through, clear_breaking)
344355

345356

0 commit comments

Comments
 (0)