Skip to content

bpo-34282: Fix Enum._convert shadowing members named _convert #8568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 12, 2018

Conversation

orlnub123
Copy link
Contributor

@orlnub123 orlnub123 commented Jul 30, 2018

I've combined the third solution with the second from the issue below, circumventing its problem.

https://bugs.python.org/issue34282

@orlnub123
Copy link
Contributor Author

Is a news entry needed?

@orlnub123 orlnub123 changed the title bpo-34282: Fix Enum._convert bpo-34282: Fix Enum._convert shadowing members named _convert Jul 31, 2018
@ethanfurman ethanfurman self-assigned this Aug 6, 2018
@orlnub123
Copy link
Contributor Author

I've gone ahead and added a news entry.

Lib/enum.py Outdated
@@ -424,6 +424,39 @@ def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, s

return enum_class

def _convert(cls, name, module, filter, source=None):
Copy link
Member

Choose a reason for hiding this comment

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

See notes in bpo issue. Thanks for your help in this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Glad to help! I've got some questions about them in the issue.

@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.

@orlnub123
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

@orlnub123
Copy link
Contributor Author

I've merged the changes from #9034.

Copy link
Member

@ethanfurman ethanfurman left a comment

Choose a reason for hiding this comment

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

Looks good! We just need one more test that verifies that usage of '_convert' in 3.8 raises a warning, and in 3.9+ raises an AttributeError.

Oh, and make sure you are in the contributors file. :)

@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.

@orlnub123
Copy link
Contributor Author

Thanks for the offer, I really appreciate it. I hope I've added myself to the right place!

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

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.

4 participants