This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients barry, eli.bendersky, eric.smith, ethan.furman, serhiy.storchaka
Date 2013-08-15.21:46:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376603210.07.0.54860483499.issue18738@psf.upfronthosting.co.za>
In-reply-to
Content
The whole point of IntEnum and replacing stdlib constants with it was friendly str & repr out of the box. This means that "just printing out" an enum member should have a nice string representation. And "just printing out" means:

print(member)
"%s" % member
"{}".format(member)

!s/!r are quite esoteric - IntEnum should behave in the nicest way possible out of the box.

Let's just rig IntEnum's __format__ to do the right thing and not worry about Enum itself. I hope that mixin-with-Enum cases are rare (and most are IntEnum anyway), and in such rare cases users are free to lift the implementation from IntEnum.
History
Date User Action Args
2013-08-15 21:46:50eli.benderskysetrecipients: + eli.bendersky, barry, eric.smith, ethan.furman, serhiy.storchaka
2013-08-15 21:46:50eli.benderskysetmessageid: <1376603210.07.0.54860483499.issue18738@psf.upfronthosting.co.za>
2013-08-15 21:46:50eli.benderskylinkissue18738 messages
2013-08-15 21:46:49eli.benderskycreate