summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@google.com>2017-05-10 09:45:06 -0700
committerStephan Hoyer <shoyer@google.com>2017-05-10 10:44:01 -0700
commite571559ded7f041acdb5130f5f8722fea44ff4ad (patch)
tree4cb7ff0417585dd5d4407937b8ed68e9dc25b2f3 /numpy/core/_internal.py
parent14ff219a13e194c5e7995218fea3c7648eb1c875 (diff)
downloadnumpy-e571559ded7f041acdb5130f5f8722fea44ff4ad.tar.gz
MAINT: refine error message for __array_ufunc__ not implemented
xref GH9079
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 10fcbfdfe..9c46b3297 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -695,10 +695,11 @@ def array_ufunc_errmsg_formatter(dummy, ufunc, method, *inputs, **kwargs):
for k, v in kwargs.items()])
args = inputs + kwargs.get('out', ())
types_string = ', '.join(repr(type(arg).__name__) for arg in args)
- return ('operand type(s) do not implement __array_ufunc__'
- '({!r}, {!r}, {}): {}'
+ return ('operand type(s) all returned NotImplemented from '
+ '__array_ufunc__({!r}, {!r}, {}): {}'
.format(ufunc, method, args_string, types_string))
+
def _ufunc_doc_signature_formatter(ufunc):
"""
Builds a signature string which resembles PEP 457