diff options
author | Michael McNeil Forbes <michael.forbes+numpy@gmail.com> | 2014-05-29 16:22:38 -0700 |
---|---|---|
committer | Michael McNeil Forbes <michael.forbes+numpy@gmail.com> | 2014-05-30 01:21:12 -0700 |
commit | 83c6d769e00e5ee424221244d9d2be474c1fe532 (patch) | |
tree | 924849c0b09b79df62dc48e1d8b5be6611779999 /numpy/lib/function_base.py | |
parent | 075872dc3d35c0c3c904b046621e7876c37b179a (diff) | |
download | numpy-83c6d769e00e5ee424221244d9d2be474c1fe532.tar.gz |
BUG: Don't let meshgrid ignore unknown kwargs. Fixes #4755.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index df5876715..9a4c47289 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -3370,9 +3370,13 @@ def meshgrid(*xi, **kwargs): """ ndim = len(xi) - copy_ = kwargs.get('copy', True) - sparse = kwargs.get('sparse', False) - indexing = kwargs.get('indexing', 'xy') + copy_ = kwargs.pop('copy', True) + sparse = kwargs.pop('sparse', False) + indexing = kwargs.pop('indexing', 'xy') + + if kwargs: + raise TypeError("meshgrid() got an unexpected keyword argument '%s'" + % (list(kwargs)[0],)) if not indexing in ['xy', 'ij']: raise ValueError( |