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

Function get_edges

mypy/server/objgraph.py:59–73  ·  view source on GitHub ↗
(o: object)

Source from the content-addressed store, hash-verified

57
58
59def get_edges(o: object) -> Iterator[tuple[object, object]]:
60 for s, e in get_edge_candidates(o):
61 if isinstance(e, FUNCTION_TYPES):
62 # We don't want to collect methods, but do want to collect values
63 # in closures and self pointers to other objects
64
65 if hasattr(e, "__closure__"):
66 yield (s, "__closure__"), e.__closure__
67 if hasattr(e, "__self__"):
68 se = e.__self__
69 if se is not o and se is not type(o) and hasattr(s, "__self__"):
70 yield s.__self__, se
71 else:
72 if type(e) not in TYPE_BLACKLIST:
73 yield s, e
74
75
76def get_reachable_graph(root: object) -> tuple[dict[int, object], dict[int, tuple[int, object]]]:

Callers 1

get_reachable_graphFunction · 0.85

Calls 4

get_edge_candidatesFunction · 0.85
isinstanceFunction · 0.85
hasattrFunction · 0.85
typeClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…