Commit ae12f5d4 authored by yahya-abou-imran's avatar yahya-abou-imran Committed by INADA Naoki

bpo-32473: Improve ABCMeta._dump_registry() readability (GH-5091)

parent 05565ed2
...@@ -170,9 +170,11 @@ class ABCMeta(type): ...@@ -170,9 +170,11 @@ class ABCMeta(type):
"""Debug helper to print the ABC registry.""" """Debug helper to print the ABC registry."""
print("Class: %s.%s" % (cls.__module__, cls.__qualname__), file=file) print("Class: %s.%s" % (cls.__module__, cls.__qualname__), file=file)
print("Inv.counter: %s" % ABCMeta._abc_invalidation_counter, file=file) print("Inv.counter: %s" % ABCMeta._abc_invalidation_counter, file=file)
for name in sorted(cls.__dict__.keys()): for name in cls.__dict__:
if name.startswith("_abc_"): if name.startswith("_abc_"):
value = getattr(cls, name) value = getattr(cls, name)
if isinstance(value, WeakSet):
value = set(value)
print("%s: %r" % (name, value), file=file) print("%s: %r" % (name, value), file=file)
def __instancecheck__(cls, instance): def __instancecheck__(cls, instance):
......
Improve ABCMeta._dump_registry() output readability
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment