R. David Murray added the comment:

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.

----------
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22318>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to