This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: No __hash__() inheritance warning with -Werror
Type: behavior Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Unchecked PyErr_WarnPy3k return value in Objects/typeobject.c
View: 8627
Assigned To: Nosy List: martin.panter, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-01-03 06:27 by martin.panter, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg284539 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-01-03 06:27
Normally there is a Python 3 compatibility warning emitted when a class is based on object, implements __eq__(), but does not define __hash__():

$ python -3 -c 'class C(object): __eq__ = lambda self, other: True'
-c:1: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x

But when warnings are raised as exceptions, this warning seems to be suppressed:

$ python -3 -Werror -c 'class C(object): __eq__ = lambda self, other: True'

Perhaps there is bad exception handling at the warn() call site.
msg284541 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-01-03 06:33
This is a duplicate of issue8627.
msg284543 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-01-03 07:55
Thanks, I will try to look at that some time
History
Date User Action Args
2022-04-11 14:58:41adminsetgithub: 73324
2017-01-03 07:55:50martin.pantersetstatus: open -> closed

messages: + msg284543
stage: needs patch -> resolved
2017-01-03 06:33:50serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg284541
resolution: duplicate

superseder: Unchecked PyErr_WarnPy3k return value in Objects/typeobject.c
2017-01-03 06:27:46martin.pantercreate