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

Method current_function

mypy/checker_shared.py:303–307  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

301 self.stack = [module]
302
303 def current_function(self) -> FuncItem | None:
304 for e in reversed(self.stack):
305 if isinstance(e, FuncItem):
306 return e
307 return None
308
309 def top_level_function(self) -> FuncItem | None:
310 """Return top-level non-lambda function."""

Callers 5

enclosing_classMethod · 0.95
active_self_typeMethod · 0.95
check_return_stmtMethod · 0.80
visit_super_exprMethod · 0.80
_super_arg_typesMethod · 0.80

Calls 2

reversedFunction · 0.85
isinstanceFunction · 0.85

Tested by

no test coverage detected