#26083: Python 2 deprecation warnings for classes that define __eq__() but not
__hash__()
--------------------------------------+------------------------------------
Reporter: atombrella | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by benf-wspdigital):
The original reporter discovered these warnings by running the test suite
for the ‘django-rest-framework‘ library.
I have followed the instructions for [http://www.django-rest-
framework.org/topics/contributing/#testing running the test suite for
django-rest-framework], and got the same warnings originally reported in
the Django code base:
{{{
$ python2 -3 -Wall ./runtests.py -q --fast
[…]
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/core/checks/messages.py:15: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class CheckMessage(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/core/cache/__init__.py:90: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class DefaultCacheProxy(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/db/__init__.py:29: DeprecationWarning: Overriding __eq__
blocks inheritance of __hash__ in 3.x
class DefaultConnectionProxy(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/core/validators.py:31: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class RegexValidator(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/core/validators.py:158: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class EmailValidator(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/core/validators.py:296: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class BaseValidator(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/core/validators.py:359: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class DecimalValidator(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/db/models/sql/datastructures.py:28: DeprecationWarning:
Overriding __eq__ blocks inheritance of __hash__ in 3.x
class Join(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/template/context.py:32: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class BaseContext(object):
/Users/benfinney/.virtualenvs/test-install/lib/python2.7/site-
packages/django/template/base.py:138: DeprecationWarning: Overriding
__eq__ blocks inheritance of __hash__ in 3.x
class Origin(object):
[…]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26083#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.c243d9816848d4163bff5db5da0ccbed%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.