MCPcopy Create free account
hub / github.com/python/mypy / BaseNonlocalControl

Class BaseNonlocalControl

mypyc/irbuild/nonlocalcontrol.py:56–66  ·  view source on GitHub ↗

Default nonlocal control outside any statements that affect it.

Source from the content-addressed store, hash-verified

54
55
56class BaseNonlocalControl(NonlocalControl):
57 """Default nonlocal control outside any statements that affect it."""
58
59 def gen_break(self, builder: IRBuilder, line: int) -> None:
60 assert False, "break outside of loop"
61
62 def gen_continue(self, builder: IRBuilder, line: int) -> None:
63 assert False, "continue outside of loop"
64
65 def gen_return(self, builder: IRBuilder, value: Value, line: int) -> None:
66 builder.add(Return(value, line))
67
68
69class LoopNonlocalControl(NonlocalControl):

Callers 2

enterMethod · 0.90
enter_scopeMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…