You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In V1 I was able to overwrite the default __hash__ method such that functools.cache would work for models that have mutable parameters (numpy array, which had its write flag set to False). This no longer works in V2.
I think I see a fix for this; I think a short-term work-around may be to do __hash__ = MyBaseModel.__hash__ in the definition of MySubClass, but I'll work on fixing so this isn't necessary.
Initial Checks
Description
In V1 I was able to overwrite the default
__hash__
method such that functools.cache would work for models that have mutable parameters (numpy array, which had its write flag set to False). This no longer works in V2.Related issues: #2423, #1880
Example Code
Python, Pydantic & OS Version
Selected Assignee: @adriangb
The text was updated successfully, but these errors were encountered: