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

Method active_class

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

Source from the content-addressed store, hash-verified

314 return None
315
316 def active_class(self) -> TypeInfo | None:
317 if isinstance(self.stack[-1], TypeInfo):
318 return self.stack[-1]
319 return None
320
321 def enclosing_class(self, func: FuncItem | None = None) -> TypeInfo | None:
322 """Is there a class *directly* enclosing this function?"""

Callers 12

active_self_typeMethod · 0.95
check_getattr_methodMethod · 0.80
check_setattr_methodMethod · 0.80
check_match_argsMethod · 0.80
visit_assignment_stmtMethod · 0.80
check_assignmentMethod · 0.80
check_finalMethod · 0.80
infer_variable_typeMethod · 0.80
_super_arg_typesMethod · 0.80

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected