Debug helper to print the ABC registry.
(cls, file=None)
| 70 | return subclass |
| 71 | |
| 72 | def _dump_registry(cls, file=None): |
| 73 | """Debug helper to print the ABC registry.""" |
| 74 | print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file) |
| 75 | print(f"Inv. counter: {get_cache_token()}", file=file) |
| 76 | for name in cls.__dict__: |
| 77 | if name.startswith("_abc_"): |
| 78 | value = getattr(cls, name) |
| 79 | if isinstance(value, WeakSet): |
| 80 | value = set(value) |
| 81 | print(f"{name}: {value!r}", file=file) |
| 82 | |
| 83 | def _abc_registry_clear(cls): |
| 84 | """Clear the registry (for debugging or testing).""" |
nothing calls this directly
no test coverage detected