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.

Author leopold.talirz
Recipients leopold.talirz, rhettinger, serhiy.storchaka
Date 2021-09-02.08:32:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1630571563.18.0.611451544619.issue45080@roundup.psfhosted.org>
In-reply-to
Content
Thanks a lot for the clarification, I get it now (I think).

> 2. _HashedSeq is only used as a key in a dictionary. When you look up a key in dictionary, it compares hashes first. __eq__ is only called when hashes match.

I was looking at the docs [1] and [2] and didn't come across this.
For me, this explanation of how __hash__ and __eq__ are used in the LRU cache would have been helpful to read in [1], but of course there is a tradeoff in how long to make docstrings.
If it is already explained somewhere else in the docs, linking to that place from [1] could be useful.

[1] https://docs.python.org/3/library/functools.html#functools.lru_cache
[2] https://docs.python.org/3/reference/datamodel.html#object.__hash__
History
Date User Action Args
2021-09-02 08:32:43leopold.talirzsetrecipients: + leopold.talirz, rhettinger, serhiy.storchaka
2021-09-02 08:32:43leopold.talirzsetmessageid: <1630571563.18.0.611451544619.issue45080@roundup.psfhosted.org>
2021-09-02 08:32:43leopold.talirzlinkissue45080 messages
2021-09-02 08:32:43leopold.talirzcreate