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

Function find_self_initializers

mypy/stubgen.py:1531–1538  ·  view source on GitHub ↗

Find attribute initializers in a method. Return a list of pairs (attribute name, r.h.s. expression).

(fdef: FuncBase)

Source from the content-addressed store, hash-verified

1529
1530
1531def find_self_initializers(fdef: FuncBase) -> list[tuple[str, Expression, Type | None]]:
1532 """Find attribute initializers in a method.
1533
1534 Return a list of pairs (attribute name, r.h.s. expression).
1535 """
1536 traverser = SelfTraverser()
1537 fdef.accept(traverser)
1538 return traverser.results
1539
1540
1541def get_qualified_name(o: Expression) -> str:

Callers 1

visit_func_defMethod · 0.85

Calls 2

SelfTraverserClass · 0.85
acceptMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…