AttributeError: 'Item' object has no attribute 'enum'
Bug #524259 reported by
Markus Korn
on 2010-02-19
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| lazr.enum |
Low
|
Ian Booth |
Bug Description
I got this error when running lp:lazr.enum
>>> from enum import Item
>>> Item('a') == Item('b')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/TEST/
self.enum == other.enum)
AttributeError: 'Item' object has no attribute 'enum'
>>>
Related branches
lp:~wallyworld/lazr.enum/json-serialisation-support
- Curtis Hovey (community): Approve (code) on 2012-04-18
-
Diff: 591 lines (+360/-67)9 files modified.bzrignore (+2/-0)
_bootstrap/bootstrap.py (+229/-46)
ez_setup.py (+1/-1)
src/lazr/enum/NEWS.txt (+7/-0)
src/lazr/enum/README.txt (+34/-0)
src/lazr/enum/__init__.py (+3/-0)
src/lazr/enum/_enum.py (+29/-19)
src/lazr/enum/_json.py (+54/-0)
src/lazr/enum/version.txt (+1/-1)
Tim Penhey (thumper) wrote : | #1 |
Robert Collins (lifeless) wrote : | #2 |
__eq__ should not raise AttributeError if two things cannot be compared - TypeError is the exception to raise. (That or never be equal).
Changed in lazr.enum: | |
status: | New → Triaged |
importance: | Undecided → Low |
Ian Booth (wallyworld)
on 2012-04-18
Changed in lazr.enum: | |
status: | Triaged → In Progress |
assignee: | nobody → Ian Booth (wallyworld) |
Ian Booth (wallyworld)
on 2012-04-19
Changed in lazr.enum: | |
milestone: | none → 1.1.4 |
Colin Watson (cjwatson) wrote : | #3 |
Fixed in lazr.enum 1.1.4 (released on 2012-04-19).
Changed in lazr.enum: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
Items only test equal if they belong to the same EnumeratedType.
I guess we could either raise a different error saying that the Item isn't part of an enumerated type, or we could just always say that they are not equal. I'm not sure I necessarily agree with either.