diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2022-01-24 17:28:33 +0100 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2022-01-24 17:29:37 +0100 |
commit | 03dc8bfbc809b43b91b4ecb8f481be1ce2644d66 (patch) | |
tree | b9f69cdb9da160293a6d1fc095e13a8a4e22296e /numpy/typing/_array_like.py | |
parent | 3fbe9852265220c77d8808210539b736be75c8c1 (diff) | |
download | numpy-03dc8bfbc809b43b91b4ecb8f481be1ce2644d66.tar.gz |
MAINT: Create the `_ArrayLike` type-alias in `numpy.typing`
Represents a subset of `npt.ArrayLike` that can be parametrized w.r.t. `np.generic`
Diffstat (limited to 'numpy/typing/_array_like.py')
-rw-r--r-- | numpy/typing/_array_like.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/typing/_array_like.py b/numpy/typing/_array_like.py index ea9ade295..02f264222 100644 --- a/numpy/typing/_array_like.py +++ b/numpy/typing/_array_like.py @@ -57,6 +57,12 @@ _FiniteNestedSequence = Union[ Sequence[Sequence[Sequence[Sequence[_T]]]], ] +# A subset of `npt.ArrayLike` that can be parametrized w.r.t. `np.generic` +_ArrayLike = Union[ + _SupportsArray["dtype[_ScalarType]"], + _NestedSequence[_SupportsArray["dtype[_ScalarType]"]], +] + # A union representing array-like objects; consists of two typevars: # One representing types that can be parametrized w.r.t. `np.dtype` # and another one for the rest |