From b6379539924568dad725f2ecc820477685f8d938 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 6 Jan 2020 01:50:02 +0000 Subject: MAINT: Implement keyword-only arguments as syntax Now that 2.7 is gone, there is no need to pop manually from kwarg dictionaries. --- numpy/lib/stride_tricks.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'numpy/lib/stride_tricks.py') diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py index 9c9da2974..502235bdf 100644 --- a/numpy/lib/stride_tricks.py +++ b/numpy/lib/stride_tricks.py @@ -197,12 +197,12 @@ def _broadcast_shape(*args): return b.shape -def _broadcast_arrays_dispatcher(*args, **kwargs): +def _broadcast_arrays_dispatcher(*args, subok=None): return args @array_function_dispatch(_broadcast_arrays_dispatcher, module='numpy') -def broadcast_arrays(*args, **kwargs): +def broadcast_arrays(*args, subok=False): """ Broadcast any number of arrays against each other. @@ -253,10 +253,6 @@ def broadcast_arrays(*args, **kwargs): # return np.nditer(args, flags=['multi_index', 'zerosize_ok'], # order='C').itviews - subok = kwargs.pop('subok', False) - if kwargs: - raise TypeError('broadcast_arrays() got an unexpected keyword ' - 'argument {!r}'.format(list(kwargs.keys())[0])) args = [np.array(_m, copy=False, subok=subok) for _m in args] shape = _broadcast_shape(*args) -- cgit v1.2.1