Author serhiy.storchaka
Recipients ethan.furman, serhiy.storchaka, terry.reedy
Date 2020-09-22.08:02:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600761728.11.0.806408234986.issue41831@roundup.psfhosted.org>
In-reply-to
Content
The tkinter.EventType enum was introduced in issue27294. It implements __str__ as returning the name for the sole purpose of using in Event.__repr__(). But overriding __str__ in the str subclass may be not good idea, because different code will get different string representation, depending on whether it calls str() explicitly or implicitly (Python code) or read the content of the str object directly using C API (C code).

The following code sets EventType.__str__ = str.__str__, so both method will get the same value. Instead Event.__repr__() was changed to use the name of the enum member directly.
History
Date User Action Args
2020-09-22 08:02:08serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, ethan.furman
2020-09-22 08:02:08serhiy.storchakasetmessageid: <1600761728.11.0.806408234986.issue41831@roundup.psfhosted.org>
2020-09-22 08:02:08serhiy.storchakalinkissue41831 messages
2020-09-22 08:02:07serhiy.storchakacreate