(o: object)
| 57 | |
| 58 | |
| 59 | def 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 | |
| 76 | def get_reachable_graph(root: object) -> tuple[dict[int, object], dict[int, tuple[int, object]]]: |
no test coverage detected
searching dependent graphs…