Skip to content

Commit

Permalink
bpo-32473: Improve ABCMeta._dump_registry() readability (pythonGH-5091)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahya-abou-imran authored and methane committed Jan 12, 2018
1 parent 05565ed commit ae12f5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,11 @@ def _dump_registry(cls, file=None):
"""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):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve ABCMeta._dump_registry() output readability

0 comments on commit ae12f5d

Please sign in to comment.