DEP: Deprecate error clearing for special method in array-coercion#19001
DEP: Deprecate error clearing for special method in array-coercion#19001charris merged 4 commits intonumpy:mainfrom
Conversation
4313e08 to
7cfac52
Compare
When looking up `__array__` and `__array_interface__`, previously most errors were ignored (during the attribute lookup for __array__). This deprecates this, in the future only AttributeError (which is ignored in `LookupSpecial` itself) will be ignored. Closes numpygh-18723
7cfac52 to
e04c760
Compare
| attributes ``__array__`` or ``__array_interface__``, this error | ||
| was usually ignored. | ||
| A warning is now given when the error is anything but AttributeError. | ||
| To silence the warning, the type raising a warning has to be adapted |
There was a problem hiding this comment.
| To silence the warning, the type raising a warning has to be adapted | |
| To silence the warning, the type raising the exception has to be adapted |
eric-wieser
left a comment
There was a problem hiding this comment.
Looks sensible, although it might be better to use the word "exception" rather than "error in a few places.
|
Well, that was confusing :). I changed the error message (error -> exception), so the warning filter was not set up correctly in the test and thus the strange failure. Should probably just squash merge this... |
|
Thanks Sebastian. |
|
Thanks. Just out of interest, is there a standard numpy timeline on moving from deprecation to exception? |
|
@radarhere typically 2 releases (EDIT: 2 releases means 1 year), although its not uncommen we forget, but after two releases we will definitely merge a PR unless there is some protest. If there are very good reasons, I guess we could speed things up after some discussion. (In this case, the only known issue was because |
When looking up
__array__and__array_interface__, previouslymost errors were ignored (during the attribute lookup for array).
This deprecates this, in the future only AttributeError (which is
ignored in
LookupSpecialitself) will be ignored.Closes gh-18723
Closes gh-18199
I feel like there is probably at least one more issue open, but didn't find it.