mypy
31dc5037 - attrs: Fix emulating hash method logic (#17016)

Commit
2 years ago
attrs: Fix emulating hash method logic (#17016) This commit fixes a couple regressions in 1.9.0 from 91be285. Attrs' logic for hashability is slightly complex: * https://www.attrs.org/en/stable/hashing.html * https://github.com/python-attrs/attrs/blob/9e443b18527dc96b194e92805fa751cbf8434ba9/src/attr/_make.py#L1660-L1689 Mypy now properly emulates attrs' logic so that custom `__hash__` implementations are preserved, `@frozen` subclasses are always hashable, and classes are only made unhashable based on the values of `eq` and `unsafe_hash`. Fixes #17015 Fixes https://github.com/python/mypy/pull/16556#issuecomment-1987116488 Based on a patch in #17012 Co-Authored-By: Tin Tvrtkovic <tinchester@gmail.com> Co-authored-by: Hashem Nasarat <hashem@hudson-trading.com>
Author
Parents
Loading