bpo-32473: Improve ABCMeta._dump_registry() readability#5091
bpo-32473: Improve ABCMeta._dump_registry() readability#5091methane merged 5 commits intopython:masterfrom DevOpsCraftsman:fix-issue-32473
Conversation
|
would you add news entry? |
|
Done! |
Lib/abc.py
Outdated
| @@ -173,6 +173,8 @@ def _dump_registry(cls, file=None): | |||
| for name in sorted(cls.__dict__.keys()): | |||
There was a problem hiding this comment.
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').
There was a problem hiding this comment.
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.
|
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 |
|
Thanks for making the requested changes! @methane: please review the changes made to this pull request. |
|
thanks |
|
Hm, I think this is safe enough to backport to 3.6. |
|
Thanks @yahya-abou-imran for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
|
GH-5163 is a backport of this pull request to the 3.6 branch. |
(cherry picked from commit ae12f5d)
https://bugs.python.org/issue32473