"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "numpy/typing/tests/data/fail/scalars.py" between
numpy-1.21.0.tar.gz and numpy-1.21.1.tar.gz

About: NumPy is the fundamental package for scientific computing with Python.

scalars.py  (numpy-1.21.0):scalars.py  (numpy-1.21.1)
import sys
import numpy as np import numpy as np
f2: np.float16 f2: np.float16
f8: np.float64 f8: np.float64
c8: np.complex64
# Construction # Construction
np.float32(3j) # E: incompatible type np.float32(3j) # E: incompatible type
# Technically the following examples are valid NumPy code. But they # Technically the following examples are valid NumPy code. But they
# are not considered a best practice, and people who wish to use the # are not considered a best practice, and people who wish to use the
# stubs should instead do # stubs should instead do
# #
# np.array([1.0, 0.0, 0.0], dtype=np.float32) # np.array([1.0, 0.0, 0.0], dtype=np.float32)
skipping to change at line 82 skipping to change at line 84
f8.item(1) # E: incompatible type f8.item(1) # E: incompatible type
f8.item((0, 1)) # E: incompatible type f8.item((0, 1)) # E: incompatible type
f8.squeeze(axis=1) # E: incompatible type f8.squeeze(axis=1) # E: incompatible type
f8.squeeze(axis=(0, 1)) # E: incompatible type f8.squeeze(axis=(0, 1)) # E: incompatible type
f8.transpose(1) # E: incompatible type f8.transpose(1) # E: incompatible type
def func(a: np.float32) -> None: ... def func(a: np.float32) -> None: ...
func(f2) # E: incompatible type func(f2) # E: incompatible type
func(f8) # E: incompatible type func(f8) # E: incompatible type
round(c8) # E: No overload variant
c8.__getnewargs__() # E: Invalid self argument
f2.__getnewargs__() # E: Invalid self argument
f2.is_integer() # E: Invalid self argument
f2.hex() # E: Invalid self argument
np.float16.fromhex("0x0.0p+0") # E: Invalid self argument
f2.__trunc__() # E: Invalid self argument
f2.__getformat__("float") # E: Invalid self argument
 End of changes. 3 change blocks. 
0 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)