Message227691
On Sep 27, 2014, at 02:59 PM, Ram Rachum wrote:
>Right now I want it for this:
>
>http://bugs.python.org/issue22504
https://docs.python.org/3/library/enum.html#orderedenum
>Another use case I can think of is that if you store enum values in a
>database, you're probably using an int field and you'd want to easily convert
>between an enum and it's int value.
Why would you do that for non-int enum values? There's lots of ways you could
store enum values in a database. In Mailman, I use "regular" enums (not
IntEnums) but I use int values and store them in the database as INTEGERS. I
could just as easily have used a string type and stored the enum member name
in the database. Using subclasses and __members__ I think there's lots of
other viable alternatives that don't require changing the Enum API. |
|
Date |
User |
Action |
Args |
2014-09-27 16:07:38 | barry | set | recipients:
+ barry, eli.bendersky, cool-RR, ethan.furman |
2014-09-27 16:07:38 | barry | link | issue22505 messages |
2014-09-27 16:07:37 | barry | create | |
|