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

Method non_function_scope

mypyc/irbuild/builder.py:626–628  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

624 self.error("Only class variables defined as ClassVar can be assigned to", line)
625
626 def non_function_scope(self) -> bool:
627 # Currently the stack always has at least two items: dummy and top-level.
628 return len(self.fn_infos) <= 2
629
630 def top_level_fn_info(self) -> FuncInfo | None:
631 if self.non_function_scope():

Callers 3

top_level_fn_infoMethod · 0.95
add_attrMethod · 0.80

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected