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 ethan.furman
Recipients barry, eli.bendersky, eric.smith, ethan.furman, serhiy.storchaka
Date 2013-08-16.07:26:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376638015.36.0.234709516748.issue18738@psf.upfronthosting.co.za>
In-reply-to
Content
Eric, please do not feel your time has been wasted.  I greatly appreciate the knowledge you shared and I learned much.

I feel very strongly that, as much as possible, an Enum should Just Work.  Requiring users to write their own __format__ any time they create a new mixinEnum in order to get sane default behaviour is just not cool.

And while the behaviour of switching from str.__format__ to mixin.__format__ can appear a bit magical, it is nothing compared to Enum as a whole.

You can review the attached patch to see what I mean about filtering the format spec to decide which __format__ method to call.  Any code besides the basic width and justification codes will switch to the mix-in's __format__; so '+', 'b', '%Y', 's', and everything we haven't thought of yet will switch to mix-in.
History
Date User Action Args
2013-08-16 07:26:55ethan.furmansetrecipients: + ethan.furman, barry, eric.smith, eli.bendersky, serhiy.storchaka
2013-08-16 07:26:55ethan.furmansetmessageid: <1376638015.36.0.234709516748.issue18738@psf.upfronthosting.co.za>
2013-08-16 07:26:55ethan.furmanlinkissue18738 messages
2013-08-16 07:26:54ethan.furmancreate