FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-32473: Improve ABCMeta._dump_registry() readability by DevOpsCraftsman · Pull Request #5091 · python/cpython · GitHub

Repository navigation

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

Merged
methane merged 5 commits into
python:masterfrom
DevOpsCraftsman:fix-issue-32473
Jan 12, 2018
Merged

methane merged 5 commits into
python:masterfrom
DevOpsCraftsman:fix-issue-32473

Conversation

DevOpsCraftsman commented Jan 3, 2018 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown

methane commented Jan 10, 2018

Copy link
Copy Markdown
Member

would you add news entry?

Copy link
Copy Markdown
Author

Done!

Comment thread Lib/abc.py Outdated
@@ -173,6 +173,8 @@ def _dump_registry(cls, file=None):
for name in sorted(cls.__dict__.keys()):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Author

I have made the requested changes; please review again

Copy link
Copy Markdown

Thanks for making the requested changes!

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

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

methane commented Jan 12, 2018

Copy link
Copy Markdown
Member

thanks

methane commented Jan 12, 2018

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown

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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL