Leopold Talirz <leopold.tal...@epfl.ch> added the comment:
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__ ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45080> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com