diff options
author | Sebastian Berg <sebastianb@nvidia.com> | 2022-11-17 14:43:18 +0100 |
---|---|---|
committer | Sebastian Berg <sebastianb@nvidia.com> | 2022-11-17 14:43:18 +0100 |
commit | 49bb24e56f12c44aad2389ecb4559bc6cedbf4e5 (patch) | |
tree | 052e6bddad451412fe21590c916aeee2802773be | |
parent | 075859216fae0509c52a54cb5c96c217f23026ca (diff) | |
download | numpy-49bb24e56f12c44aad2389ecb4559bc6cedbf4e5.tar.gz |
TYP: Remove newly deprecated scalar type aliases
-rw-r--r-- | numpy/__init__.pyi | 10 | ||||
-rw-r--r-- | numpy/typing/tests/data/pass/scalars.py | 7 | ||||
-rw-r--r-- | numpy/typing/tests/data/reveal/scalars.pyi | 8 |
3 files changed, 0 insertions, 25 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi index 9ee634742..0a3bbcdb3 100644 --- a/numpy/__init__.pyi +++ b/numpy/__init__.pyi @@ -2744,8 +2744,6 @@ class bool_(generic): __gt__: _ComparisonOp[_NumberLike_co, _ArrayLikeNumber_co] __ge__: _ComparisonOp[_NumberLike_co, _ArrayLikeNumber_co] -bool8 = bool_ - class object_(generic): def __init__(self, value: object = ..., /) -> None: ... @property @@ -2758,8 +2756,6 @@ class object_(generic): def __float__(self) -> float: ... def __complex__(self) -> complex: ... -object0 = object_ - # The `datetime64` constructors requires an object with the three attributes below, # and thus supports datetime duck typing class _DatetimeScalar(Protocol): @@ -2882,7 +2878,6 @@ byte = signedinteger[_NBitByte] short = signedinteger[_NBitShort] intc = signedinteger[_NBitIntC] intp = signedinteger[_NBitIntP] -int0 = signedinteger[_NBitIntP] int_ = signedinteger[_NBitInt] longlong = signedinteger[_NBitLongLong] @@ -2964,7 +2959,6 @@ ubyte = unsignedinteger[_NBitByte] ushort = unsignedinteger[_NBitShort] uintc = unsignedinteger[_NBitIntC] uintp = unsignedinteger[_NBitIntP] -uint0 = unsignedinteger[_NBitIntP] uint = unsignedinteger[_NBitInt] ulonglong = unsignedinteger[_NBitLongLong] @@ -3089,8 +3083,6 @@ class void(flexible): value: ArrayLike, ) -> None: ... -void0 = void - class character(flexible): # type: ignore def __int__(self) -> int: ... def __float__(self) -> float: ... @@ -3111,7 +3103,6 @@ class bytes_(character, bytes): def tolist(self) -> bytes: ... string_ = bytes_ -bytes0 = bytes_ class str_(character, str): @overload @@ -3126,7 +3117,6 @@ class str_(character, str): def tolist(self) -> str: ... unicode_ = str_ -str0 = str_ # # Constants diff --git a/numpy/typing/tests/data/pass/scalars.py b/numpy/typing/tests/data/pass/scalars.py index 684d41fad..124681bcb 100644 --- a/numpy/typing/tests/data/pass/scalars.py +++ b/numpy/typing/tests/data/pass/scalars.py @@ -173,18 +173,12 @@ c16.byteswap() c16.transpose() # Aliases -np.str0() -np.bool8() -np.bytes0() np.string_() -np.object0() -np.void0(0) np.byte() np.short() np.intc() np.intp() -np.int0() np.int_() np.longlong() @@ -192,7 +186,6 @@ np.ubyte() np.ushort() np.uintc() np.uintp() -np.uint0() np.uint() np.ulonglong() diff --git a/numpy/typing/tests/data/reveal/scalars.pyi b/numpy/typing/tests/data/reveal/scalars.pyi index 383e40ef0..b7fc75acc 100644 --- a/numpy/typing/tests/data/reveal/scalars.pyi +++ b/numpy/typing/tests/data/reveal/scalars.pyi @@ -35,7 +35,6 @@ reveal_type(c8.real) # E: {float32} reveal_type(c16.imag) # E: {float64} reveal_type(np.unicode_('foo')) # E: str_ -reveal_type(np.str0('foo')) # E: str_ reveal_type(V[0]) # E: Any reveal_type(V["field1"]) # E: Any @@ -44,18 +43,12 @@ V[0] = 5 # Aliases reveal_type(np.unicode_()) # E: str_ -reveal_type(np.str0()) # E: str_ -reveal_type(np.bool8()) # E: bool_ -reveal_type(np.bytes0()) # E: bytes_ reveal_type(np.string_()) # E: bytes_ -reveal_type(np.object0()) # E: object_ -reveal_type(np.void0(0)) # E: void reveal_type(np.byte()) # E: {byte} reveal_type(np.short()) # E: {short} reveal_type(np.intc()) # E: {intc} reveal_type(np.intp()) # E: {intp} -reveal_type(np.int0()) # E: {intp} reveal_type(np.int_()) # E: {int_} reveal_type(np.longlong()) # E: {longlong} @@ -63,7 +56,6 @@ reveal_type(np.ubyte()) # E: {ubyte} reveal_type(np.ushort()) # E: {ushort} reveal_type(np.uintc()) # E: {uintc} reveal_type(np.uintp()) # E: {uintp} -reveal_type(np.uint0()) # E: {uintp} reveal_type(np.uint()) # E: {uint} reveal_type(np.ulonglong()) # E: {ulonglong} |