-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-41831: Restore str implementation of __str__ in tkinter.EventType #22355
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
bpo-41831: Restore str implementation of __str__ in tkinter.EventType #22355
Conversation
e0d499e to
565bc9f
Compare
| @@ -185,8 +185,7 @@ class EventType(str, enum.Enum): | |||
| Deactivate = '37', | |||
| MouseWheel = '38', | |||
|
|
|||
| def __str__(self): | |||
| return self.name | |||
| __str__ = str.__str__ | |||
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.
This line is unnecessary if subclassing the new StrEnum, which my patch did. Just remove the def __str__ and we're good.
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.
However, this is exactly the change we want for 3.8 and 3.9.
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9. |
|
GH-22622 is a backport of this pull request to the 3.9 branch. |
…pythonGH-22355) (cherry picked from commit eb38c6b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
GH-22623 is a backport of this pull request to the 3.8 branch. |
…pythonGH-22355) (cherry picked from commit eb38c6b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
https://bugs.python.org/issue41831