mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-32473: Improve ABCMeta._dump_registry() readability (GH-5091)
This commit is contained in:
parent
05565ed27e
commit
ae12f5d4c9
2 changed files with 4 additions and 1 deletions
|
@ -170,9 +170,11 @@ class ABCMeta(type):
|
|||
"""Debug helper to print the ABC registry."""
|
||||
print("Class: %s.%s" % (cls.__module__, cls.__qualname__), 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_"):
|
||||
value = getattr(cls, name)
|
||||
if isinstance(value, WeakSet):
|
||||
value = set(value)
|
||||
print("%s: %r" % (name, value), file=file)
|
||||
|
||||
def __instancecheck__(cls, instance):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue