Skip to content

Conversation

@DevOpsCraftsman
Copy link

@DevOpsCraftsman DevOpsCraftsman commented Jan 3, 2018

@methane
Copy link
Member

methane commented Jan 10, 2018

would you add news entry?

@DevOpsCraftsman
Copy link
Author

Done!

Lib/abc.py Outdated
"""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()):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorted() is not needed anymore because dict order is stable.

Other option is whitelist members ('_abc_registry', '_abc_cache', '_abc_negative_cache', '_abc_negative_cache_version').

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the whitelist: a suitable order increase also readability...
But I think to stick with if name.startswith("_abc_") is easier to maintain.
I was told that this will be rewritten in C, so it's not a big deal.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@DevOpsCraftsman
Copy link
Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@methane: please review the changes made to this pull request.

@methane methane changed the title bpo-32473 Improve ABCMeta._dump_registry() readability bpo-32473: Improve ABCMeta._dump_registry() readability Jan 12, 2018
@methane methane merged commit ae12f5d into python:master Jan 12, 2018
@methane
Copy link
Member

methane commented Jan 12, 2018

thanks

@methane
Copy link
Member

methane commented Jan 12, 2018

Hm, I think this is safe enough to backport to 3.6.

@miss-islington
Copy link
Contributor

Thanks @yahya-abou-imran for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-5163 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 12, 2018
methane pushed a commit that referenced this pull request Jan 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants