diff options
author | Bas van Beek <b.f.van.beek@vu.nl> | 2020-10-16 16:37:42 +0200 |
---|---|---|
committer | Bas van Beek <b.f.van.beek@vu.nl> | 2020-10-17 18:05:13 +0200 |
commit | 95a391c53cd227fe48c33e03ff1d95f342ae31f5 (patch) | |
tree | ad6557cabfe39091f6bdd5620b6f66102f1da938 | |
parent | 27d586465760a47cd1754ad07fff813f3517e775 (diff) | |
download | numpy-95a391c53cd227fe48c33e03ff1d95f342ae31f5.tar.gz |
TST: Add support for precision to the arithmetic and bitwise ops tests
-rw-r--r-- | numpy/typing/tests/data/reveal/arithmetic.py | 332 | ||||
-rw-r--r-- | numpy/typing/tests/data/reveal/bitwise_ops.py | 206 |
2 files changed, 269 insertions, 269 deletions
diff --git a/numpy/typing/tests/data/reveal/arithmetic.py b/numpy/typing/tests/data/reveal/arithmetic.py index b8c457aaf..a1290304a 100644 --- a/numpy/typing/tests/data/reveal/arithmetic.py +++ b/numpy/typing/tests/data/reveal/arithmetic.py @@ -45,212 +45,212 @@ reveal_type(td - i8) # E: numpy.timedelta64 reveal_type(td / f) # E: numpy.timedelta64 reveal_type(td / f4) # E: numpy.timedelta64 reveal_type(td / f8) # E: numpy.timedelta64 -reveal_type(td / td) # E: float64 -reveal_type(td // td) # E: signedinteger +reveal_type(td / td) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(td // td) # E: numpy.signedinteger[numpy.typing._64Bit] reveal_type(td % td) # E: numpy.timedelta64 # boolean -reveal_type(b_ / b) # E: float64 -reveal_type(b_ / b_) # E: float64 -reveal_type(b_ / i) # E: float64 -reveal_type(b_ / i8) # E: float64 -reveal_type(b_ / i4) # E: float64 -reveal_type(b_ / u8) # E: float64 -reveal_type(b_ / u4) # E: float64 -reveal_type(b_ / f) # E: float64 -reveal_type(b_ / f8) # E: float64 -reveal_type(b_ / f4) # E: float32 -reveal_type(b_ / c) # E: complex128 -reveal_type(b_ / c16) # E: complex128 -reveal_type(b_ / c8) # E: complex64 +reveal_type(b_ / b) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / i) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / i8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / i4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / u8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / u4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / f) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / f4) # E: numpy.floating[numpy.typing._32Bit] +reveal_type(b_ / c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(b_ / c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(b_ / c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] -reveal_type(b / b_) # E: float64 -reveal_type(b_ / b_) # E: float64 -reveal_type(i / b_) # E: float64 -reveal_type(i8 / b_) # E: float64 -reveal_type(i4 / b_) # E: float64 -reveal_type(u8 / b_) # E: float64 -reveal_type(u4 / b_) # E: float64 -reveal_type(f / b_) # E: float64 -reveal_type(f8 / b_) # E: float64 -reveal_type(f4 / b_) # E: float32 -reveal_type(c / b_) # E: complex128 -reveal_type(c16 / b_) # E: complex128 -reveal_type(c8 / b_) # E: complex64 +reveal_type(b / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i8 / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i4 / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(u8 / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(u4 / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 / b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f4 / b_) # E: numpy.floating[numpy.typing._32Bit] +reveal_type(c / b_) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 / b_) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 / b_) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] # Complex -reveal_type(c16 + c16) # E: complexfloating -reveal_type(c16 + f8) # E: complexfloating -reveal_type(c16 + i8) # E: complexfloating -reveal_type(c16 + c8) # E: complexfloating -reveal_type(c16 + f4) # E: complexfloating -reveal_type(c16 + i4) # E: complexfloating -reveal_type(c16 + b_) # E: complex128 -reveal_type(c16 + b) # E: complexfloating -reveal_type(c16 + c) # E: complexfloating -reveal_type(c16 + f) # E: complexfloating -reveal_type(c16 + i) # E: complexfloating +reveal_type(c16 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + f8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + i8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + c8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + f4) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + i4) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + b_) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + b) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + f) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c16 + i) # E: numpy.complexfloating[Any, Any] reveal_type(c16 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(c16 + c16) # E: complexfloating -reveal_type(f8 + c16) # E: complexfloating -reveal_type(i8 + c16) # E: complexfloating -reveal_type(c8 + c16) # E: complexfloating -reveal_type(f4 + c16) # E: complexfloating -reveal_type(i4 + c16) # E: complexfloating -reveal_type(b_ + c16) # E: complex128 -reveal_type(b + c16) # E: complexfloating -reveal_type(c + c16) # E: complexfloating -reveal_type(f + c16) # E: complexfloating -reveal_type(i + c16) # E: complexfloating +reveal_type(c16 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f8 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(i8 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f4 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(i4 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(b_ + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(b + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(i + c16) # E: numpy.complexfloating[Any, Any] reveal_type(AR + c16) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(c8 + c16) # E: complexfloating -reveal_type(c8 + f8) # E: complexfloating -reveal_type(c8 + i8) # E: complexfloating -reveal_type(c8 + c8) # E: complexfloating -reveal_type(c8 + f4) # E: complexfloating -reveal_type(c8 + i4) # E: complexfloating -reveal_type(c8 + b_) # E: complex64 -reveal_type(c8 + b) # E: complexfloating -reveal_type(c8 + c) # E: complexfloating -reveal_type(c8 + f) # E: complexfloating -reveal_type(c8 + i) # E: complexfloating +reveal_type(c8 + c16) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + f8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + i8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(c8 + f4) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(c8 + i4) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(c8 + b_) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(c8 + b) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(c8 + c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + f) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + i) # E: numpy.complexfloating[Any, Any] reveal_type(c8 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(c16 + c8) # E: complexfloating -reveal_type(f8 + c8) # E: complexfloating -reveal_type(i8 + c8) # E: complexfloating -reveal_type(c8 + c8) # E: complexfloating -reveal_type(f4 + c8) # E: complexfloating -reveal_type(i4 + c8) # E: complexfloating -reveal_type(b_ + c8) # E: complex64 -reveal_type(b + c8) # E: complexfloating -reveal_type(c + c8) # E: complexfloating -reveal_type(f + c8) # E: complexfloating -reveal_type(i + c8) # E: complexfloating +reveal_type(c16 + c8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f8 + c8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(i8 + c8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(c8 + c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(f4 + c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(i4 + c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(b_ + c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(b + c8) # E: numpy.complexfloating[numpy.typing._32Bit, numpy.typing._32Bit] +reveal_type(c + c8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f + c8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(i + c8) # E: numpy.complexfloating[Any, Any] reveal_type(AR + c8) # E: Union[numpy.ndarray, numpy.generic] # Float -reveal_type(f8 + f8) # E: floating -reveal_type(f8 + i8) # E: floating -reveal_type(f8 + f4) # E: floating -reveal_type(f8 + i4) # E: floating -reveal_type(f8 + b_) # E: float64 -reveal_type(f8 + b) # E: floating -reveal_type(f8 + c) # E: complexfloating -reveal_type(f8 + f) # E: floating -reveal_type(f8 + i) # E: floating +reveal_type(f8 + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + i8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + f4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + i4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + b_) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + b) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f8 + f) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f8 + i) # E: numpy.floating[Any] reveal_type(f8 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(f8 + f8) # E: floating -reveal_type(i8 + f8) # E: floating -reveal_type(f4 + f8) # E: floating -reveal_type(i4 + f8) # E: floating -reveal_type(b_ + f8) # E: float64 -reveal_type(b + f8) # E: floating -reveal_type(c + f8) # E: complexfloating -reveal_type(f + f8) # E: floating -reveal_type(i + f8) # E: floating +reveal_type(f8 + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i8 + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f4 + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i4 + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b_ + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(b + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(c + f8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i + f8) # E: numpy.floating[Any] reveal_type(AR + f8) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(f4 + f8) # E: floating -reveal_type(f4 + i8) # E: floating -reveal_type(f4 + f4) # E: floating -reveal_type(f4 + i4) # E: floating -reveal_type(f4 + b_) # E: float32 -reveal_type(f4 + b) # E: floating -reveal_type(f4 + c) # E: complexfloating -reveal_type(f4 + f) # E: floating -reveal_type(f4 + i) # E: floating +reveal_type(f4 + f8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f4 + i8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f4 + f4) # E: numpy.floating[numpy.typing._32Bit] +reveal_type(f4 + i4) # E: numpy.floating[numpy.typing._32Bit] +reveal_type(f4 + b_) # E: numpy.floating[numpy.typing._32Bit] +reveal_type(f4 + b) # E: numpy.floating[numpy.typing._32Bit] +reveal_type(f4 + c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f4 + f) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f4 + i) # E: numpy.floating[Any] reveal_type(f4 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(f8 + f4) # E: floating -reveal_type(i8 + f4) # E: floating -reveal_type(f4 + f4) # E: floating -reveal_type(i4 + f4) # E: floating -reveal_type(b_ + f4) # E: float32 -reveal_type(b + f4) # E: floating -reveal_type(c + f4) # E: complexfloating -reveal_type(f + f4) # E: floating -reveal_type(i + f4) # E: floating +reveal_type(f8 + f4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i8 + f4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(f4 + f4) # E: umpy.floating[numpy.typing._32Bit] +reveal_type(i4 + f4) # E: umpy.floating[numpy.typing._32Bit] +reveal_type(b_ + f4) # E: umpy.floating[numpy.typing._32Bit] +reveal_type(b + f4) # E: umpy.floating[numpy.typing._32Bit] +reveal_type(c + f4) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f + f4) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i + f4) # E: numpy.floating[Any] reveal_type(AR + f4) # E: Union[numpy.ndarray, numpy.generic] # Int -reveal_type(i8 + i8) # E: signedinteger -reveal_type(i8 + u8) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(i8 + i4) # E: signedinteger -reveal_type(i8 + u4) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(i8 + b_) # E: int64 -reveal_type(i8 + b) # E: signedinteger -reveal_type(i8 + c) # E: complexfloating -reveal_type(i8 + f) # E: floating -reveal_type(i8 + i) # E: signedinteger +reveal_type(i8 + i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 + u8) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(i8 + i4) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 + u4) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(i8 + b_) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 + b) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 + c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(i8 + f) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i8 + i) # E: numpy.signedinteger[Any] reveal_type(i8 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(u8 + u8) # E: unsignedinteger -reveal_type(u8 + i4) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(u8 + u4) # E: unsignedinteger -reveal_type(u8 + b_) # E: uint64 -reveal_type(u8 + b) # E: unsignedinteger -reveal_type(u8 + c) # E: complexfloating -reveal_type(u8 + f) # E: floating -reveal_type(u8 + i) # E: Union[numpy.signedinteger, numpy.float64] +reveal_type(u8 + u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 + i4) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(u8 + u4) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 + b_) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 + b) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 + c) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(u8 + f) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(u8 + i) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] reveal_type(u8 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(i8 + i8) # E: signedinteger -reveal_type(u8 + i8) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(i4 + i8) # E: signedinteger -reveal_type(u4 + i8) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(b_ + i8) # E: int64 -reveal_type(b + i8) # E: signedinteger -reveal_type(c + i8) # E: complexfloating -reveal_type(f + i8) # E: floating -reveal_type(i + i8) # E: signedinteger +reveal_type(i8 + i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(u8 + i8) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(i4 + i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(u4 + i8) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(b_ + i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(b + i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(c + i8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f + i8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i + i8) # E: numpy.signedinteger[Any] reveal_type(AR + i8) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(u8 + u8) # E: unsignedinteger -reveal_type(i4 + u8) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(u4 + u8) # E: unsignedinteger -reveal_type(b_ + u8) # E: uint64 -reveal_type(b + u8) # E: unsignedinteger -reveal_type(c + u8) # E: complexfloating -reveal_type(f + u8) # E: floating -reveal_type(i + u8) # E: Union[numpy.signedinteger, numpy.float64] +reveal_type(u8 + u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(i4 + u8) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(u4 + u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(b_ + u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(b + u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(c + u8) # E: numpy.complexfloating[numpy.typing._64Bit, numpy.typing._64Bit] +reveal_type(f + u8) # E: numpy.floating[numpy.typing._64Bit] +reveal_type(i + u8) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] reveal_type(AR + u8) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(i4 + i8) # E: signedinteger -reveal_type(i4 + i4) # E: signedinteger -reveal_type(i4 + i) # E: signedinteger -reveal_type(i4 + b_) # E: int32 -reveal_type(i4 + b) # E: signedinteger +reveal_type(i4 + i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i4 + i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i4 + i) # E: numpy.signedinteger[Any] +reveal_type(i4 + b_) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i4 + b) # E: numpy.signedinteger[numpy.typing._32Bit] reveal_type(i4 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(u4 + i8) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(u4 + i4) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(u4 + u8) # E: unsignedinteger -reveal_type(u4 + u4) # E: unsignedinteger -reveal_type(u4 + i) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(u4 + b_) # E: uint32 -reveal_type(u4 + b) # E: unsignedinteger +reveal_type(u4 + i8) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(u4 + i4) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(u4 + u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u4 + u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(u4 + i) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(u4 + b_) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(u4 + b) # E: numpy.unsignedinteger[numpy.typing._32Bit] reveal_type(u4 + AR) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(i8 + i4) # E: signedinteger -reveal_type(i4 + i4) # E: signedinteger -reveal_type(i + i4) # E: signedinteger -reveal_type(b_ + i4) # E: int32 -reveal_type(b + i4) # E: signedinteger +reveal_type(i8 + i4) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i4 + i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i + i4) # E: numpy.signedinteger[Any] +reveal_type(b_ + i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(b + i4) # E: numpy.signedinteger[numpy.typing._32Bit] reveal_type(AR + i4) # E: Union[numpy.ndarray, numpy.generic] -reveal_type(i8 + u4) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(i4 + u4) # E: Union[numpy.signedinteger, numpy.float64] -reveal_type(u8 + u4) # E: unsignedinteger -reveal_type(u4 + u4) # E: unsignedinteger -reveal_type(b_ + u4) # E: uint32 -reveal_type(b + u4) # E: unsignedinteger -reveal_type(i + u4) # E: Union[numpy.signedinteger, numpy.float64] +reveal_type(i8 + u4) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(i4 + u4) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] +reveal_type(u8 + u4) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u4 + u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(b_ + u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(b + u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(i + u4) # E: Union[numpy.signedinteger[Any], numpy.floating[numpy.typing._64Bit]] reveal_type(AR + u4) # E: Union[numpy.ndarray, numpy.generic] diff --git a/numpy/typing/tests/data/reveal/bitwise_ops.py b/numpy/typing/tests/data/reveal/bitwise_ops.py index ae899f47b..6883532f2 100644 --- a/numpy/typing/tests/data/reveal/bitwise_ops.py +++ b/numpy/typing/tests/data/reveal/bitwise_ops.py @@ -15,117 +15,117 @@ AR = np.array([0, 1, 2], dtype=np.int32) AR.setflags(write=False) -reveal_type(i8 << i8) # E: numpy.signedinteger -reveal_type(i8 >> i8) # E: numpy.signedinteger -reveal_type(i8 | i8) # E: numpy.signedinteger -reveal_type(i8 ^ i8) # E: numpy.signedinteger -reveal_type(i8 & i8) # E: numpy.signedinteger - -reveal_type(i8 << AR) # E: Union[numpy.ndarray, numpy.integer] -reveal_type(i8 >> AR) # E: Union[numpy.ndarray, numpy.integer] -reveal_type(i8 | AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] -reveal_type(i8 ^ AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] -reveal_type(i8 & AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] - -reveal_type(i4 << i4) # E: numpy.signedinteger -reveal_type(i4 >> i4) # E: numpy.signedinteger -reveal_type(i4 | i4) # E: numpy.signedinteger -reveal_type(i4 ^ i4) # E: numpy.signedinteger -reveal_type(i4 & i4) # E: numpy.signedinteger - -reveal_type(i8 << i4) # E: numpy.signedinteger -reveal_type(i8 >> i4) # E: numpy.signedinteger -reveal_type(i8 | i4) # E: numpy.signedinteger -reveal_type(i8 ^ i4) # E: numpy.signedinteger -reveal_type(i8 & i4) # E: numpy.signedinteger - -reveal_type(i8 << i) # E: numpy.signedinteger -reveal_type(i8 >> i) # E: numpy.signedinteger -reveal_type(i8 | i) # E: numpy.signedinteger -reveal_type(i8 ^ i) # E: numpy.signedinteger -reveal_type(i8 & i) # E: numpy.signedinteger - -reveal_type(i8 << b_) # E: numpy.int64 -reveal_type(i8 >> b_) # E: numpy.int64 -reveal_type(i8 | b_) # E: numpy.int64 -reveal_type(i8 ^ b_) # E: numpy.int64 -reveal_type(i8 & b_) # E: numpy.int64 - -reveal_type(i8 << b) # E: numpy.signedinteger -reveal_type(i8 >> b) # E: numpy.signedinteger -reveal_type(i8 | b) # E: numpy.signedinteger -reveal_type(i8 ^ b) # E: numpy.signedinteger -reveal_type(i8 & b) # E: numpy.signedinteger - -reveal_type(u8 << u8) # E: numpy.unsignedinteger -reveal_type(u8 >> u8) # E: numpy.unsignedinteger -reveal_type(u8 | u8) # E: numpy.unsignedinteger -reveal_type(u8 ^ u8) # E: numpy.unsignedinteger -reveal_type(u8 & u8) # E: numpy.unsignedinteger - -reveal_type(u8 << AR) # E: Union[numpy.ndarray, numpy.integer] -reveal_type(u8 >> AR) # E: Union[numpy.ndarray, numpy.integer] -reveal_type(u8 | AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] -reveal_type(u8 ^ AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] -reveal_type(u8 & AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] - -reveal_type(u4 << u4) # E: numpy.unsignedinteger -reveal_type(u4 >> u4) # E: numpy.unsignedinteger -reveal_type(u4 | u4) # E: numpy.unsignedinteger -reveal_type(u4 ^ u4) # E: numpy.unsignedinteger -reveal_type(u4 & u4) # E: numpy.unsignedinteger - -reveal_type(u4 << i4) # E: numpy.signedinteger -reveal_type(u4 >> i4) # E: numpy.signedinteger -reveal_type(u4 | i4) # E: numpy.signedinteger -reveal_type(u4 ^ i4) # E: numpy.signedinteger -reveal_type(u4 & i4) # E: numpy.signedinteger - -reveal_type(u4 << i) # E: numpy.signedinteger -reveal_type(u4 >> i) # E: numpy.signedinteger -reveal_type(u4 | i) # E: numpy.signedinteger -reveal_type(u4 ^ i) # E: numpy.signedinteger -reveal_type(u4 & i) # E: numpy.signedinteger - -reveal_type(u8 << b_) # E: numpy.uint64 -reveal_type(u8 >> b_) # E: numpy.uint64 -reveal_type(u8 | b_) # E: numpy.uint64 -reveal_type(u8 ^ b_) # E: numpy.uint64 -reveal_type(u8 & b_) # E: numpy.uint64 - -reveal_type(u8 << b) # E: numpy.unsignedinteger -reveal_type(u8 >> b) # E: numpy.unsignedinteger -reveal_type(u8 | b) # E: numpy.unsignedinteger -reveal_type(u8 ^ b) # E: numpy.unsignedinteger -reveal_type(u8 & b) # E: numpy.unsignedinteger - -reveal_type(b_ << b_) # E: numpy.int8 -reveal_type(b_ >> b_) # E: numpy.int8 +reveal_type(i8 << i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 >> i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 | i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 ^ i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 & i8) # E: numpy.signedinteger[numpy.typing._64Bit] + +reveal_type(i8 << AR) # E: Union[numpy.ndarray, numpy.integer[Any]] +reveal_type(i8 >> AR) # E: Union[numpy.ndarray, numpy.integer[Any]] +reveal_type(i8 | AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] +reveal_type(i8 ^ AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] +reveal_type(i8 & AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] + +reveal_type(i4 << i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i4 >> i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i4 | i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i4 ^ i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(i4 & i4) # E: numpy.signedinteger[numpy.typing._32Bit] + +reveal_type(i8 << i4) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 >> i4) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 | i4) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 ^ i4) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 & i4) # E: numpy.signedinteger[numpy.typing._64Bit] + +reveal_type(i8 << i) # E: numpy.signedinteger[Any] +reveal_type(i8 >> i) # E: numpy.signedinteger[Any] +reveal_type(i8 | i) # E: numpy.signedinteger[Any] +reveal_type(i8 ^ i) # E: numpy.signedinteger[Any] +reveal_type(i8 & i) # E: numpy.signedinteger[Any] + +reveal_type(i8 << b_) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 >> b_) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 | b_) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 ^ b_) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 & b_) # E: numpy.signedinteger[numpy.typing._64Bit] + +reveal_type(i8 << b) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 >> b) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 | b) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 ^ b) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(i8 & b) # E: numpy.signedinteger[numpy.typing._64Bit] + +reveal_type(u8 << u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 >> u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 | u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 ^ u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 & u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] + +reveal_type(u8 << AR) # E: Union[numpy.ndarray, numpy.integer[Any]] +reveal_type(u8 >> AR) # E: Union[numpy.ndarray, numpy.integer[Any]] +reveal_type(u8 | AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] +reveal_type(u8 ^ AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] +reveal_type(u8 & AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] + +reveal_type(u4 << u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(u4 >> u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(u4 | u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(u4 ^ u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] +reveal_type(u4 & u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] + +reveal_type(u4 << i4) # E: numpy.signedinteger[Any] +reveal_type(u4 >> i4) # E: numpy.signedinteger[Any] +reveal_type(u4 | i4) # E: numpy.signedinteger[Any] +reveal_type(u4 ^ i4) # E: numpy.signedinteger[Any] +reveal_type(u4 & i4) # E: numpy.signedinteger[Any] + +reveal_type(u4 << i) # E: numpy.signedinteger[Any] +reveal_type(u4 >> i) # E: numpy.signedinteger[Any] +reveal_type(u4 | i) # E: numpy.signedinteger[Any] +reveal_type(u4 ^ i) # E: numpy.signedinteger[Any] +reveal_type(u4 & i) # E: numpy.signedinteger[Any] + +reveal_type(u8 << b_) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 >> b_) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 | b_) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 ^ b_) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 & b_) # E: numpy.unsignedinteger[numpy.typing._64Bit] + +reveal_type(u8 << b) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 >> b) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 | b) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 ^ b) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(u8 & b) # E: numpy.unsignedinteger[numpy.typing._64Bit] + +reveal_type(b_ << b_) # E: numpy.signedinteger[numpy.typing._8Bit] +reveal_type(b_ >> b_) # E: numpy.signedinteger[numpy.typing._8Bit] reveal_type(b_ | b_) # E: numpy.bool_ reveal_type(b_ ^ b_) # E: numpy.bool_ reveal_type(b_ & b_) # E: numpy.bool_ -reveal_type(b_ << AR) # E: Union[numpy.ndarray, numpy.integer] -reveal_type(b_ >> AR) # E: Union[numpy.ndarray, numpy.integer] -reveal_type(b_ | AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] -reveal_type(b_ ^ AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] -reveal_type(b_ & AR) # E: Union[numpy.ndarray, numpy.integer, numpy.bool_] +reveal_type(b_ << AR) # E: Union[numpy.ndarray, numpy.integer[Any]] +reveal_type(b_ >> AR) # E: Union[numpy.ndarray, numpy.integer[Any]] +reveal_type(b_ | AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] +reveal_type(b_ ^ AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] +reveal_type(b_ & AR) # E: Union[numpy.ndarray, numpy.integer[Any], numpy.bool_] -reveal_type(b_ << b) # E: numpy.int8 -reveal_type(b_ >> b) # E: numpy.int8 +reveal_type(b_ << b) # E: numpy.signedinteger[numpy.typing._8Bit] +reveal_type(b_ >> b) # E: numpy.signedinteger[numpy.typing._8Bit] reveal_type(b_ | b) # E: numpy.bool_ reveal_type(b_ ^ b) # E: numpy.bool_ reveal_type(b_ & b) # E: numpy.bool_ -reveal_type(b_ << i) # E: Union[numpy.int32, numpy.int64] -reveal_type(b_ >> i) # E: Union[numpy.int32, numpy.int64] -reveal_type(b_ | i) # E: Union[numpy.int32, numpy.int64] -reveal_type(b_ ^ i) # E: Union[numpy.int32, numpy.int64] -reveal_type(b_ & i) # E: Union[numpy.int32, numpy.int64] +reveal_type(b_ << i) # E: numpy.signedinteger[Any] +reveal_type(b_ >> i) # E: numpy.signedinteger[Any] +reveal_type(b_ | i) # E: numpy.signedinteger[Any] +reveal_type(b_ ^ i) # E: numpy.signedinteger[Any] +reveal_type(b_ & i) # E: numpy.signedinteger[Any] -reveal_type(~i8) # E: numpy.int64 -reveal_type(~i4) # E: numpy.int32 -reveal_type(~u8) # E: numpy.uint64 -reveal_type(~u4) # E: numpy.uint32 +reveal_type(~i8) # E: numpy.signedinteger[numpy.typing._64Bit] +reveal_type(~i4) # E: numpy.signedinteger[numpy.typing._32Bit] +reveal_type(~u8) # E: numpy.unsignedinteger[numpy.typing._64Bit] +reveal_type(~u4) # E: numpy.unsignedinteger[numpy.typing._32Bit] reveal_type(~b_) # E: numpy.bool_ -reveal_type(~AR) # E: Union[numpy.ndarray*, numpy.integer, numpy.bool_] +reveal_type(~AR) # E: Union[numpy.ndarray*, numpy.integer[Any], numpy.bool_] |