-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-106602: Add __copy__ and __deepcopy__ in Enum #106666
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
Conversation
Agent-Hellboy
commented
Jul 12, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: [Enum] add __deepcopy__ method to Enum #106602
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good!
A couple minor issues to fix and then we can commit.
Lib/enum.py
Outdated
@@ -1226,6 +1226,12 @@ def __reduce_ex__(self, proto): | |||
# on class lookup; on instance lookup it either executes a provided function | |||
# or raises an AttributeError. | |||
|
|||
def __deepcopy__(self,memo): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move these two methods above the enum.property
comment.
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 |
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
I have made the requested changes; please review again |
Thanks for making the requested changes! @ethanfurman: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thanks @Agent-Hellboy for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Thanks @Agent-Hellboy for the PR, and @ethanfurman for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
(cherry picked from commit 357e9e9) Co-authored-by: Prince Roshan <princekrroshan01@gmail.com>
GH-106694 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit 357e9e9) Co-authored-by: Prince Roshan <princekrroshan01@gmail.com>
GH-106695 is a backport of this pull request to the 3.12 branch. |