diff options
-rw-r--r-- | numpy/typing/__init__.py | 22 | ||||
-rw-r--r-- | numpy/typing/_array_like.py | 24 |
2 files changed, 23 insertions, 23 deletions
diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py index 1f656ad66..97b87a682 100644 --- a/numpy/typing/__init__.py +++ b/numpy/typing/__init__.py @@ -301,17 +301,17 @@ from ._array_like import ( _ArrayLike, _NestedSequence, _SupportsArray, - _ArrayLikeBool, - _ArrayLikeUInt, - _ArrayLikeInt, - _ArrayLikeFloat, - _ArrayLikeComplex, - _ArrayLikeTD64, - _ArrayLikeDT64, - _ArrayLikeObject, - _ArrayLikeVoid, - _ArrayLikeStr, - _ArrayLikeBytes, + _ArrayLikeBool_co, + _ArrayLikeUInt_co, + _ArrayLikeInt_co, + _ArrayLikeFloat_co, + _ArrayLikeComplex_co, + _ArrayLikeTD64_co, + _ArrayLikeDT64_co, + _ArrayLikeObject_co, + _ArrayLikeVoid_co, + _ArrayLikeStr_co, + _ArrayLikeBytes_co, ) if __doc__ is not None: diff --git a/numpy/typing/_array_like.py b/numpy/typing/_array_like.py index d6473442c..35413393c 100644 --- a/numpy/typing/_array_like.py +++ b/numpy/typing/_array_like.py @@ -78,41 +78,41 @@ ArrayLike = Union[ ], ] -# `ArrayLike<X>`: array-like objects that can be coerced into `X` +# `ArrayLike<X>_co`: array-like objects that can be coerced into `X` # given the casting rules `same_kind` -_ArrayLikeBool = _ArrayLike[ +_ArrayLikeBool_co = _ArrayLike[ "dtype[bool_]", bool, ] -_ArrayLikeUInt = _ArrayLike[ +_ArrayLikeUInt_co = _ArrayLike[ "dtype[Union[bool_, unsignedinteger[Any]]]", bool, ] -_ArrayLikeInt = _ArrayLike[ +_ArrayLikeInt_co = _ArrayLike[ "dtype[Union[bool_, integer[Any]]]", Union[bool, int], ] -_ArrayLikeFloat = _ArrayLike[ +_ArrayLikeFloat_co = _ArrayLike[ "dtype[Union[bool_, integer[Any], floating[Any]]]", Union[bool, int, float], ] -_ArrayLikeComplex = _ArrayLike[ +_ArrayLikeComplex_co = _ArrayLike[ "dtype[Union[bool_, integer[Any], floating[Any], complexfloating[Any, Any]]]", Union[bool, int, float, complex], ] -_ArrayLikeTD64 = _ArrayLike[ +_ArrayLikeTD64_co = _ArrayLike[ "dtype[Union[bool_, integer[Any], timedelta64]]", Union[bool, int], ] -_ArrayLikeDT64 = _NestedSequence[_SupportsArray["dtype[datetime64]"]] -_ArrayLikeObject = _NestedSequence[_SupportsArray["dtype[object_]"]] +_ArrayLikeDT64_co = _NestedSequence[_SupportsArray["dtype[datetime64]"]] +_ArrayLikeObject_co = _NestedSequence[_SupportsArray["dtype[object_]"]] -_ArrayLikeVoid = _NestedSequence[_SupportsArray["dtype[void]"]] -_ArrayLikeStr = _ArrayLike[ +_ArrayLikeVoid_co = _NestedSequence[_SupportsArray["dtype[void]"]] +_ArrayLikeStr_co = _ArrayLike[ "dtype[str_]", str, ] -_ArrayLikeBytes = _ArrayLike[ +_ArrayLikeBytes_co = _ArrayLike[ "dtype[bytes_]", bytes, ] |