Message226198
I'm not sure what you saw when "reading the code". I don't see any 'a is b' in there (only 'elem is NULL', which is correct).
This has nothing to do with unittest, and everything to do with how == is defined/implemented in python. The invariant is that if two objects are equal, their hashes *must* be equal, and the hash check is used as a fastpath to skip items that are not equal without doing a full comparison. If you implement __eq__, you must implement __hash__ (or set it to None, thus marking the objects as not hashable). Not doing so is an error in Python3 (and probably also in python2 if you are using new style classes, but I didn't check).
So, it is your objects that are buggy, I'm afraid, not unittest. |
|
Date |
User |
Action |
Args |
2014-09-01 01:25:03 | r.david.murray | set | recipients:
+ r.david.murray, docs@python, TonyFlury |
2014-09-01 01:25:03 | r.david.murray | set | messageid: <1409534703.88.0.72525192785.issue22318@psf.upfronthosting.co.za> |
2014-09-01 01:25:03 | r.david.murray | link | issue22318 messages |
2014-09-01 01:25:03 | r.david.murray | create | |
|