Make example __hash__ closer to reality

Fixes #327
This commit is contained in:
Hynek Schlawack 2018-01-18 11:22:59 +01:00
parent 8278088a70
commit 1357de7471
1 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ To bring it into perspective, the equivalent of
>>> SmartClass(1, 2)
SmartClass(a=1, b=2)
is
is roughly
.. doctest::
@ -219,7 +219,7 @@ is
... return NotImplemented
...
... def __hash__(self):
... return hash((self.a, self.b))
... return hash((self.__class__, self.a, self.b))
>>> ArtisanalClass(a=1, b=2)
ArtisanalClass(a=1, b=2)