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/core/numeric.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index ae3dcd07a..c875e7b03 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1721,7 +1721,7 @@ def indices(dimensions, dtype=int, sparse=False): @set_module('numpy') -def fromfunction(function, shape, **kwargs): +def fromfunction(function, shape, *, dtype=float, **kwargs): """ Construct an array by executing a function over each coordinate. @@ -1772,7 +1772,6 @@ def fromfunction(function, shape, **kwargs): [2, 3, 4]]) """ - dtype = kwargs.pop('dtype', float) args = indices(shape, dtype=dtype) return function(*args, **kwargs) -- cgit v1.2.1