Skip to content

Commit

Permalink
MAINT: Rename the old _ArrayLike parameter used inside the `_array_…
Browse files Browse the repository at this point in the history
…like` module
  • Loading branch information
Bas van Beek committed Jan 24, 2022
1 parent 5264dc2 commit 3fbe985
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions numpy/typing/_array_like.py
Expand Up @@ -60,7 +60,7 @@ def __array_function__(
# 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
_ArrayLike = Union[
_DualArrayLike = Union[
_SupportsArray[_DType],
_NestedSequence[_SupportsArray[_DType]],
_T,
Expand All @@ -74,38 +74,38 @@ def __array_function__(
# is resolved. See also the mypy issue:
#
# https://github.com/python/typing/issues/593
ArrayLike = _ArrayLike[
ArrayLike = _DualArrayLike[
dtype,
Union[bool, int, float, complex, str, bytes],
]

# `ArrayLike<X>_co`: array-like objects that can be coerced into `X`
# given the casting rules `same_kind`
_ArrayLikeBool_co = _ArrayLike[
_ArrayLikeBool_co = _DualArrayLike[
"dtype[bool_]",
bool,
]
_ArrayLikeUInt_co = _ArrayLike[
_ArrayLikeUInt_co = _DualArrayLike[
"dtype[Union[bool_, unsignedinteger[Any]]]",
bool,
]
_ArrayLikeInt_co = _ArrayLike[
_ArrayLikeInt_co = _DualArrayLike[
"dtype[Union[bool_, integer[Any]]]",
Union[bool, int],
]
_ArrayLikeFloat_co = _ArrayLike[
_ArrayLikeFloat_co = _DualArrayLike[
"dtype[Union[bool_, integer[Any], floating[Any]]]",
Union[bool, int, float],
]
_ArrayLikeComplex_co = _ArrayLike[
_ArrayLikeComplex_co = _DualArrayLike[
"dtype[Union[bool_, integer[Any], floating[Any], complexfloating[Any, Any]]]",
Union[bool, int, float, complex],
]
_ArrayLikeNumber_co = _ArrayLike[
_ArrayLikeNumber_co = _DualArrayLike[
"dtype[Union[bool_, number[Any]]]",
Union[bool, int, float, complex],
]
_ArrayLikeTD64_co = _ArrayLike[
_ArrayLikeTD64_co = _DualArrayLike[
"dtype[Union[bool_, integer[Any], timedelta64]]",
Union[bool, int],
]
Expand All @@ -122,16 +122,16 @@ def __array_function__(
_SupportsArray["dtype[void]"],
_NestedSequence[_SupportsArray["dtype[void]"]],
]
_ArrayLikeStr_co = _ArrayLike[
_ArrayLikeStr_co = _DualArrayLike[
"dtype[str_]",
str,
]
_ArrayLikeBytes_co = _ArrayLike[
_ArrayLikeBytes_co = _DualArrayLike[
"dtype[bytes_]",
bytes,
]

_ArrayLikeInt = _ArrayLike[
_ArrayLikeInt = _DualArrayLike[
"dtype[integer[Any]]",
int,
]

0 comments on commit 3fbe985

Please sign in to comment.