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

Function attributes_maybe_initialized_by_init_call

mypyc/analysis/attrdefined.py:294–299  ·  view source on GitHub ↗

Calculate attributes that may be initialized by a super().__init__ call.

(op: Call)

Source from the content-addressed store, hash-verified

292
293
294def attributes_maybe_initialized_by_init_call(op: Call) -> set[str]:
295 """Calculate attributes that may be initialized by a super().__init__ call."""
296 self_type = op.fn.sig.args[0].type
297 assert isinstance(self_type, RInstance), self_type
298 cl = self_type.class_ir
299 return attributes_initialized_by_init_call(op) | cl._sometimes_initialized_attrs
300
301
302class AttributeMaybeDefinedVisitor(BaseAnalysisVisitor[str]):

Callers 1

visit_register_opMethod · 0.85

Calls 2

isinstanceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…