[issue28263] Python 2.7's `-3` flag warns about __eq__ being implemented without __hash__ even if __hash__ is never accessed.

2016-09-24 Thread Christian Heimes
Christian Heimes added the comment: Antti is correct. Please add __hash__ = None to your class to silence the warning. -- nosy: +christian.heimes resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue28263] Python 2.7's `-3` flag warns about __eq__ being implemented without __hash__ even if __hash__ is never accessed.

2016-09-24 Thread Ned Batchelder
Changes by Ned Batchelder : -- nosy: +nedbat ___ Python tracker ___ ___

[issue28263] Python 2.7's `-3` flag warns about __eq__ being implemented without __hash__ even if __hash__ is never accessed.

2016-09-24 Thread Antti Haapala
Antti Haapala added the comment: I am very negative to this idea. Correct code in Python **2** would either set `__hash__ = None` or redefine `__hash__` in *any* class that defines `__eq__`. That it just wasn't used like that is no excuse. This warning is even more important if even Ned

[issue28263] Python 2.7's `-3` flag warns about __eq__ being implemented without __hash__ even if __hash__ is never accessed.

2016-09-23 Thread Roy Williams
New submission from Roy Williams: I'm finding the -3 flag to be super useful at identifying problems with code when porting to Python 3. One of the most common failures, however, is "DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x". While implementing __eq__