MCPcopy
hub / github.com/python/mypy / enter_class

Method enter_class

mypy/semanal.py:2217–2225  ·  view source on GitHub ↗
(self, info: TypeInfo)

Source from the content-addressed store, hash-verified

2215 value.accept(self)
2216
2217 def enter_class(self, info: TypeInfo) -> None:
2218 # Remember previous active class
2219 self.type_stack.append(self.type)
2220 self.locals.append(None) # Add class scope
2221 self.scope_stack.append(SCOPE_CLASS)
2222 self.block_depth.append(-1) # The class body increments this to 0
2223 self.loop_depth.append(0)
2224 self._type = info
2225 self.missing_names.append(set())
2226
2227 def leave_class(self) -> None:
2228 """Restore analyzer state."""

Callers 2

file_contextMethod · 0.95

Calls 2

setClass · 0.85
appendMethod · 0.80

Tested by

no test coverage detected