-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dataclasses library is NOT backward compatible #99401
Comments
This is called out in https://docs.python.org/3.11/whatsnew/3.11.html#dataclasses and it feels unlikely we'll go back on this change. cc @ericvsmith though. |
@JelleZijlstra @ericvsmith So if I add a |
@yonikremer : Yes, I think so (although I can't test it just now). Your other option is to use a |
Could another option (just workaround) be using |
Doesn't it affect all dataclasses that have numpy arrays as default values? |
As Eric mentions, the fix you probably want is to use a Closing as per #99401 (comment) |
Hello, For jax, JAX arrays are immutable but not hashable. So this goes against the proxy method used. Moreover, JAX Arrays can not be subclassed to add a This change will break the JAX array annotation for dataclasses. |
I would suggest that e029c53 has a logical flaw, and should be considered a bug. It's true that hashability implies immutability; but it's not true that immutability implies hashability. The commit in question assumes the latter, and thus the logic is flawed: there are valid, immutable values that incorrectly lead to an error because they happen to not have a hash function. Is there any possibility that the team would consider rolling back e029c53 due to this flaw in its logic? |
Reference: python/cpython#99401 Signed-off-by: Harish Rajagopal <harish.rajagopals@gmail.com>
One of the changes in the dataclasses library in Python 3.11 (Python 3.10 works fine) is causing backward compatibility issues with the datasets library by hugging face.
When you import the datasets library using python 3.11 you get the following error:
To reproduce the error, run my kaggle kernels notebook
The text was updated successfully, but these errors were encountered: