summaryrefslogtreecommitdiff
path: root/numpy/core/function_base.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2019-07-08 23:31:26 -0700
committerEric Wieser <wieser.eric@gmail.com>2019-07-08 23:31:26 -0700
commitf730ea85c441e2af73a3f1d19f86412240bc106d (patch)
tree83171c3dc8ddbc7426cc5b3d0bf0bbd77f6272b8 /numpy/core/function_base.py
parent54f9fc5c60976abb34e3dae6a9eae902fcf61dfc (diff)
downloadnumpy-f730ea85c441e2af73a3f1d19f86412240bc106d.tar.gz
MAINT: Enforce that `add_newdocs` is called with sequences of the right size
Previously this would silently ignore extra items
Diffstat (limited to 'numpy/core/function_base.py')
-rw-r--r--numpy/core/function_base.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py
index aee78d734..661b744b1 100644
--- a/numpy/core/function_base.py
+++ b/numpy/core/function_base.py
@@ -472,7 +472,8 @@ def add_newdoc(place, obj, doc):
if isinstance(doc, str):
_add_docstring(new, doc.strip())
elif isinstance(doc, tuple):
- _add_docstring(getattr(new, doc[0]), doc[1].strip())
+ attr, docstring = doc
+ _add_docstring(getattr(new, attr), docstring.strip())
elif isinstance(doc, list):
- for val in doc:
- _add_docstring(getattr(new, val[0]), val[1].strip())
+ for attr, docstring in doc:
+ _add_docstring(getattr(new, attr), docstring.strip())