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

Method is_nested_within_func_scope

mypy/semanal.py:7440–7442  ·  view source on GitHub ↗

Are we underneath a function scope, even if we are in a nested class also?

(self)

Source from the content-addressed store, hash-verified

7438 return scope_type in (SCOPE_FUNC, SCOPE_COMPREHENSION)
7439
7440 def is_nested_within_func_scope(self) -> bool:
7441 """Are we underneath a function scope, even if we are in a nested class also?"""
7442 return any(s in (SCOPE_FUNC, SCOPE_COMPREHENSION) for s in self.scope_stack)
7443
7444 def is_class_scope(self) -> bool:
7445 return self.type is not None and not self.is_func_scope()

Callers 1

prepare_class_defMethod · 0.95

Calls 1

anyFunction · 0.85

Tested by

no test coverage detected