From f730ea85c441e2af73a3f1d19f86412240bc106d Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 8 Jul 2019 23:31:26 -0700 Subject: MAINT: Enforce that `add_newdocs` is called with sequences of the right size Previously this would silently ignore extra items --- numpy/core/function_base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'numpy/core/function_base.py') 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()) -- cgit v1.2.1