Message272693
I tried to implement this once. The biggest problem I encountered is inconsistency with Enum identity: Enum's main idea is that its objects are pre-created and __new__ just return one of them, so equality is simply identity.
If you try to do this with flags, you quickly hit the exponential blowup and with most flags applications, it's utterly impractical to construct all the combinations at the start. So you have MyFlags.a|MyFlags.b is not MyFlags.a|MyFlags.b, and that is very weird and unexpected (especially if MyFlags.a is MyFlags.a, which it is if this case just delegates to Enum.__new__).
How does this patch propose to solve this problem? |
|
Date |
User |
Action |
Args |
2016-08-14 20:49:51 | veky | set | recipients:
+ veky, barry, ezio.melotti, r.david.murray, eli.bendersky, ethan.furman, martin.panter, serhiy.storchaka |
2016-08-14 20:49:51 | veky | set | messageid: <1471207791.38.0.0254658876462.issue23591@psf.upfronthosting.co.za> |
2016-08-14 20:49:51 | veky | link | issue23591 messages |
2016-08-14 20:49:51 | veky | create | |
|