diff options
author | Bas van Beek <43369155+BvB93@users.noreply.github.com> | 2020-10-07 18:53:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-07 19:53:33 +0300 |
commit | fd01786ea4c7dde540cede258ad11d08d25bacfc (patch) | |
tree | 6601706476da64b117088d6bbe368bc18521cb53 /numpy/typing/_array_like.py | |
parent | 2378c3c987c479cca27470d3d66b5d50e91ad673 (diff) | |
download | numpy-fd01786ea4c7dde540cede258ad11d08d25bacfc.tar.gz |
MAINT: Move aliases for common scalar unions to `numpy.typing` (#17429)
* MAINT: Move the `<scalar>Like` unions to `numpy.typing`
Diffstat (limited to 'numpy/typing/_array_like.py')
-rw-r--r-- | numpy/typing/_array_like.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/typing/_array_like.py b/numpy/typing/_array_like.py index 76c0c839c..1c00b200f 100644 --- a/numpy/typing/_array_like.py +++ b/numpy/typing/_array_like.py @@ -2,6 +2,7 @@ import sys from typing import Any, overload, Sequence, TYPE_CHECKING, Union from numpy import ndarray +from ._scalars import _ScalarLike from ._dtype_like import DtypeLike if sys.version_info >= (3, 8): @@ -31,4 +32,9 @@ else: # is resolved. See also the mypy issue: # # https://github.com/python/typing/issues/593 -ArrayLike = Union[bool, int, float, complex, _SupportsArray, Sequence] +ArrayLike = Union[ + _ScalarLike, + Sequence[_ScalarLike], + Sequence[Sequence[Any]], # TODO: Wait for support for recursive types + _SupportsArray, +] |