diff options
author | Peter Andreas Entschev <peter@entschev.com> | 2020-11-19 02:07:48 -0800 |
---|---|---|
committer | Peter Andreas Entschev <peter@entschev.com> | 2020-11-19 02:08:38 -0800 |
commit | 1d7ad47a7bddfbdcdedbebe81ca87636f2e746ab (patch) | |
tree | fee42bacc6c37c6697194bc48d4972b2616c7aec /numpy/core/numeric.py | |
parent | 196c6d1df7b51f0d49ece7e93d37ee82b8ca221f (diff) | |
download | numpy-1d7ad47a7bddfbdcdedbebe81ca87636f2e746ab.tar.gz |
REV: Make like= in Python functions strict
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index f0d1f163a..25235f738 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -21,9 +21,7 @@ from .multiarray import ( from . import overrides from . import umath from . import shape_base -from .overrides import ( - array_function_dispatch_like, set_array_function_like_doc, set_module - ) +from .overrides import set_array_function_like_doc, set_module from .umath import (multiply, invert, sin, PINF, NAN) from . import numerictypes from .numerictypes import longlong, intc, int_, float_, complex_, bool_ @@ -200,9 +198,7 @@ def ones(shape, dtype=None, order='C', *, like=None): """ if like is not None: - return array_function_dispatch_like( - _ones_with_like, shape, dtype=dtype, order=order, like=like - ) + return _ones_with_like(shape, dtype=dtype, order=order, like=like) a = empty(shape, dtype, order) multiarray.copyto(a, 1, casting='unsafe') @@ -338,14 +334,7 @@ def full(shape, fill_value, dtype=None, order='C', *, like=None): """ if like is not None: - return array_function_dispatch_like( - _full_with_like, - shape, - fill_value, - dtype=dtype, - order=order, - like=like, - ) + return _full_with_like(shape, fill_value, dtype=dtype, order=order, like=like) if dtype is None: fill_value = asarray(fill_value) @@ -1858,14 +1847,7 @@ def fromfunction(function, shape, *, dtype=float, like=None, **kwargs): """ if like is not None: - return array_function_dispatch_like( - _fromfunction_with_like, - function, - shape, - dtype=dtype, - like=like, - **kwargs, - ) + return _fromfunction_with_like(function, shape, dtype=dtype, like=like, **kwargs) args = indices(shape, dtype=dtype) return function(*args, **kwargs) @@ -2186,9 +2168,7 @@ def identity(n, dtype=None, *, like=None): """ if like is not None: - return array_function_dispatch_like( - _identity_with_like, n, dtype=dtype, like=like - ) + return _identity_with_like(n, dtype=dtype, like=like) from numpy import eye return eye(n, dtype=dtype, like=like) |