diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-01-06 01:50:02 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-01-06 12:51:55 +0000 |
commit | b6379539924568dad725f2ecc820477685f8d938 (patch) | |
tree | c0516e000911eebe166884a90b12140eac46d187 /numpy/core/numeric.py | |
parent | ba81c4200f289b393755d954f7450804ec8f897a (diff) | |
download | numpy-b6379539924568dad725f2ecc820477685f8d938.tar.gz |
MAINT: Implement keyword-only arguments as syntax
Now that 2.7 is gone, there is no need to pop manually from kwarg dictionaries.
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 3 |
1 files changed, 1 insertions, 2 deletions
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) |