summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2020-01-06 01:50:02 +0000
committerEric Wieser <wieser.eric@gmail.com>2020-01-06 12:51:55 +0000
commitb6379539924568dad725f2ecc820477685f8d938 (patch)
treec0516e000911eebe166884a90b12140eac46d187 /numpy/core/numeric.py
parentba81c4200f289b393755d954f7450804ec8f897a (diff)
downloadnumpy-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.py3
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)