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
DEP: Expire deprecation of dtype/signature allowing instances #22540
Conversation
We never really allowed instances here and deprecated it since NumPy 1.21 (it just failed completely in 1.21.0).
@@ -0,0 +1,3 @@ | |||
* Passing dtype instances other than the default ones to | |||
``dtype=`` or ``signature=` in ufuncs will now raise a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"default" could use some clarification. I assume some of the outdate alternate (example?) types are deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, tried to make it more specific. Basically, I still allow the singleton instances (and things that are equivalent to it). But really, we only enforce the DType (class/type) anyway, and are just generous about allowing those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW the new wording LGTM and matches the terminology (i.e. "canonical") in the relevant NEPs
We still allow the "singleton" instances (which mainly applies to our own dtypes), mainly because it wouldn't really do much good to disallow them, even if they are not specific (since we don't enforce the byte-order, but we never return non-native byte order for example).
ef38bff
to
ec23c51
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo an rst formatting nit in the release note. Thanks @seberg !
@@ -0,0 +1,3 @@ | |||
* Passing dtype instances other than the default ones to | |||
``dtype=`` or ``signature=` in ufuncs will now raise a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW the new wording LGTM and matches the terminology (i.e. "canonical") in the relevant NEPs
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
Thanks Sebastian, |
We never really allowed instances here and deprecated it since NumPy 1.21 (it just failed completely in 1.21.0).