B
Ben Finney
Howdy all,
I've uploaded enum 0.2 to the Cheeseshop.
The main change is that enumeration values now export their enumtype,
index, and key (the things that define each value) as attributes.
Thanks to Bengt for making a convincing case in favour of this.
So now it's easier to ask an enumeration value about itself:
tue
I've uploaded enum 0.2 to the Cheeseshop.
The main change is that enumeration values now export their enumtype,
index, and key (the things that define each value) as attributes.
Thanks to Bengt for making a convincing case in favour of this.
So now it's easier to ask an enumeration value about itself:
['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']>>> from enum import Enum
>>> Weekdays = Enum('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat')
>>> print [str(v) for v in Weekdays]
tue