In Python 3.3, support auto-numbering of items
Bug #1110507 reported by
Barry Warsaw
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
flufl.enum |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
Since Python 3.3 supports knowing the order of item definitions in the class, we could support auto numbering of items. We still need a syntax to indicate that autonumbering is requested. Possibly:
class Colors(Enum):
red = None
blue = None
green = None
?
Changed in flufl.enum: | |
milestone: | none → 3.4 |
To post a comment you must log in.
Or possibly
from flufl.enum import Enum, auto
class Colors(Enum):
red = auto
blue = auto
green = auto
?