getattr syntax should support enum value as argument
Bug #1124596 reported by
Barry Warsaw
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
flufl.enum |
Fix Released
|
Wishlist
|
Barry Warsaw |
Bug Description
This should be legal:
>>> from flufl.enum import make
>>> Colors = make('Colors', 'red green blue'.split())
>>> Colors[Colors.red]
Traceback (most recent call last):
File "/usr/lib/
return getattr(cls, i)
TypeError: getattr(): attribute name must be string
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
raise ValueError(i)
ValueError: Colors.red
Changed in flufl.enum: | |
milestone: | none → 3.4 |
assignee: | nobody → Barry Warsaw (barry) |
status: | New → In Progress |
Changed in flufl.enum: | |
status: | In Progress → Triaged |
milestone: | 3.4 → none |
Changed in flufl.enum: | |
milestone: | none → 3.4 |
status: | Triaged → Fix Committed |
Changed in flufl.enum: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.