Message195313
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. |
|
Date |
User |
Action |
Args |
2013-08-16 07:26:55 | ethan.furman | set | recipients:
+ ethan.furman, barry, eric.smith, eli.bendersky, serhiy.storchaka |
2013-08-16 07:26:55 | ethan.furman | set | messageid: <1376638015.36.0.234709516748.issue18738@psf.upfronthosting.co.za> |
2013-08-16 07:26:55 | ethan.furman | link | issue18738 messages |
2013-08-16 07:26:54 | ethan.furman | create | |
|