summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2021-05-19 14:27:49 -0700
committerGitHub <noreply@github.com>2021-05-19 15:27:49 -0600
commit290a0345c8a0eb33ba98172267e6d392110fe905 (patch)
tree29ce02d76a0b181d21b24ed2262fa4229ca19632 /doc
parente108c76f870c94d5fd2f50126cc40cb1258d89e3 (diff)
downloadnumpy-290a0345c8a0eb33ba98172267e6d392110fe905.tar.gz
DEP: Deprecate error clearing for special method in array-coercion (#19001)
* DEP: Deprecate error clearing for special method in array-coercion 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 gh-18723 * DOC: Fixups from Eric's review and prefer exception over error * TST: Fixup the error message in the test as well Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/release/upcoming_changes/19001.deprecation.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/release/upcoming_changes/19001.deprecation.rst b/doc/release/upcoming_changes/19001.deprecation.rst
new file mode 100644
index 000000000..48087f8a5
--- /dev/null
+++ b/doc/release/upcoming_changes/19001.deprecation.rst
@@ -0,0 +1,8 @@
+Exceptions will be raised during array-like creation
+----------------------------------------------------
+When an object raised an exception during access of the special
+attributes ``__array__`` or ``__array_interface__``, this exception
+was usually ignored.
+A warning is now given when the exception is anything but AttributeError.
+To silence the warning, the type raising the exception has to be adapted
+to raise an ``AttributeError``.