(path: list[tuple[object, object]])
| 67 | |
| 68 | |
| 69 | def path_to_str(path: list[tuple[object, object]]) -> str: |
| 70 | result = "<root>" |
| 71 | for attr, obj in path: |
| 72 | t = type(obj).__name__ |
| 73 | if t in ("dict", "tuple", "SymbolTable", "list"): |
| 74 | result += f"[{repr(attr)}]" |
| 75 | else: |
| 76 | if isinstance(obj, Var): |
| 77 | result += f".{attr}({t}:{obj.name})" |
| 78 | elif t in ("BuildManager", "FineGrainedBuildManager"): |
| 79 | # Omit class name for some classes that aren't part of a class |
| 80 | # hierarchy since there isn't much ambiguity. |
| 81 | result += f".{attr}" |
| 82 | else: |
| 83 | result += f".{attr}({t})" |
| 84 | return result |
no test coverage detected
searching dependent graphs…