-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Version: 3.4.0
Platform: Python 3.7
Description:
in the new version Redis model has __eq__
implemented but not __hash__
.
Python docs(https://docs.python.org/3/reference/datamodel.html#object.__hash):
if it defines eq() but not hash(), its instances will not be usable as items in hashable collections.
A class that overrides eq() and does not define hash() will have its hash() implicitly set to None. When the hash() method of a class is None, instances of the class will raise an appropriate TypeError when a program attempts to retrieve their hash value, and will also be correctly identified as unhashable when checking isinstance(obj, collections.abc.Hashable).
If a class that overrides eq() needs to retain the implementation of hash() from a parent class, the interpreter must be told this explicitly by setting hash = .hash.
Shouldn't Redis implement __hash__
then?
There is an issue with kombu
related to it: celery/kombu#1152