$85 GRAYBYTE WORDPRESS FILE MANAGER $27

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.100
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/typing/tests/data/fail/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/typing/tests/data/fail//scalars.pyi
import sys
import numpy as np

f2: np.float16
f8: np.float64
c8: np.complex64

# Construction

np.float32(3j)  # E: incompatible type

# Technically the following examples are valid NumPy code. But they
# are not considered a best practice, and people who wish to use the
# stubs should instead do
#
# np.array([1.0, 0.0, 0.0], dtype=np.float32)
# np.array([], dtype=np.complex64)
#
# See e.g. the discussion on the mailing list
#
# https://mail.python.org/pipermail/numpy-discussion/2020-April/080566.html
#
# and the issue
#
# https://github.com/numpy/numpy-stubs/issues/41
#
# for more context.
np.float32([1.0, 0.0, 0.0])  # E: incompatible type
np.complex64([])  # E: incompatible type

np.complex64(1, 2)  # E: Too many arguments
# TODO: protocols (can't check for non-existent protocols w/ __getattr__)

np.datetime64(0)  # E: No overload variant

class A:
    def __float__(self):
        return 1.0


np.int8(A())  # E: incompatible type
np.int16(A())  # E: incompatible type
np.int32(A())  # E: incompatible type
np.int64(A())  # E: incompatible type
np.uint8(A())  # E: incompatible type
np.uint16(A())  # E: incompatible type
np.uint32(A())  # E: incompatible type
np.uint64(A())  # E: incompatible type

np.void("test")  # E: No overload variant
np.void("test", dtype=None)  # E: No overload variant

np.generic(1)  # E: Cannot instantiate abstract class
np.number(1)  # E: Cannot instantiate abstract class
np.integer(1)  # E: Cannot instantiate abstract class
np.inexact(1)  # E: Cannot instantiate abstract class
np.character("test")  # E: Cannot instantiate abstract class
np.flexible(b"test")  # E: Cannot instantiate abstract class

np.float64(value=0.0)  # E: Unexpected keyword argument
np.int64(value=0)  # E: Unexpected keyword argument
np.uint64(value=0)  # E: Unexpected keyword argument
np.complex128(value=0.0j)  # E: Unexpected keyword argument
np.str_(value='bob')  # E: No overload variant
np.bytes_(value=b'test')  # E: No overload variant
np.void(value=b'test')  # E: No overload variant
np.bool_(value=True)  # E: Unexpected keyword argument
np.datetime64(value="2019")  # E: No overload variant
np.timedelta64(value=0)  # E: Unexpected keyword argument

np.bytes_(b"hello", encoding='utf-8')  # E: No overload variant
np.str_("hello", encoding='utf-8')  # E: No overload variant

f8.item(1)  # E: incompatible type
f8.item((0, 1))  # E: incompatible type
f8.squeeze(axis=1)  # E: incompatible type
f8.squeeze(axis=(0, 1))  # E: incompatible type
f8.transpose(1)  # E: incompatible type

def func(a: np.float32) -> None: ...

func(f2)  # 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.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


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
11 Feb 2026 9.30 AM
root / root
0755
arithmetic.pyi
3.76 KB
20 Jan 2026 1.01 PM
root / root
0644
array_constructors.pyi
1.063 KB
20 Jan 2026 1.01 PM
root / root
0644
array_like.pyi
0.444 KB
20 Jan 2026 1.01 PM
root / root
0644
array_pad.pyi
0.129 KB
20 Jan 2026 1.01 PM
root / root
0644
arrayprint.pyi
0.536 KB
20 Jan 2026 1.01 PM
root / root
0644
arrayterator.pyi
0.469 KB
20 Jan 2026 1.01 PM
root / root
0644
bitwise_ops.pyi
0.503 KB
20 Jan 2026 1.01 PM
root / root
0644
char.pyi
2.554 KB
20 Jan 2026 1.01 PM
root / root
0644
chararray.pyi
2.242 KB
20 Jan 2026 1.01 PM
root / root
0644
comparisons.pyi
0.867 KB
20 Jan 2026 1.01 PM
root / root
0644
constants.pyi
0.279 KB
20 Jan 2026 1.01 PM
root / root
0644
datasource.pyi
0.386 KB
20 Jan 2026 1.01 PM
root / root
0644
dtype.pyi
0.326 KB
20 Jan 2026 1.01 PM
root / root
0644
einsumfunc.pyi
0.526 KB
20 Jan 2026 1.01 PM
root / root
0644
false_positives.pyi
0.357 KB
20 Jan 2026 1.01 PM
root / root
0644
flatiter.pyi
0.823 KB
20 Jan 2026 1.01 PM
root / root
0644
fromnumeric.pyi
5.46 KB
20 Jan 2026 1.01 PM
root / root
0644
histograms.pyi
0.358 KB
20 Jan 2026 1.01 PM
root / root
0644
index_tricks.pyi
0.497 KB
20 Jan 2026 1.01 PM
root / root
0644
lib_function_base.pyi
2.032 KB
20 Jan 2026 1.01 PM
root / root
0644
lib_polynomial.pyi
0.892 KB
20 Jan 2026 1.01 PM
root / root
0644
lib_utils.pyi
0.27 KB
20 Jan 2026 1.01 PM
root / root
0644
lib_version.pyi
0.154 KB
20 Jan 2026 1.01 PM
root / root
0644
linalg.pyi
1.291 KB
20 Jan 2026 1.01 PM
root / root
0644
memmap.pyi
0.155 KB
20 Jan 2026 1.01 PM
root / root
0644
modules.pyi
0.637 KB
20 Jan 2026 1.01 PM
root / root
0644
multiarray.pyi
1.653 KB
20 Jan 2026 1.01 PM
root / root
0644
ndarray.pyi
0.396 KB
20 Jan 2026 1.01 PM
root / root
0644
ndarray_misc.pyi
1.34 KB
20 Jan 2026 1.01 PM
root / root
0644
nditer.pyi
0.317 KB
20 Jan 2026 1.01 PM
root / root
0644
nested_sequence.pyi
0.417 KB
20 Jan 2026 1.01 PM
root / root
0644
npyio.pyi
0.762 KB
20 Jan 2026 1.01 PM
root / root
0644
numerictypes.pyi
0.27 KB
20 Jan 2026 1.01 PM
root / root
0644
random.pyi
2.764 KB
20 Jan 2026 1.01 PM
root / root
0644
rec.pyi
0.688 KB
20 Jan 2026 1.01 PM
root / root
0644
scalars.pyi
2.883 KB
20 Jan 2026 1.01 PM
root / root
0644
shape_base.pyi
0.148 KB
20 Jan 2026 1.01 PM
root / root
0644
stride_tricks.pyi
0.308 KB
20 Jan 2026 1.01 PM
root / root
0644
testing.pyi
1.338 KB
20 Jan 2026 1.01 PM
root / root
0644
twodim_base.pyi
0.878 KB
20 Jan 2026 1.01 PM
root / root
0644
type_check.pyi
0.37 KB
20 Jan 2026 1.01 PM
root / root
0644
ufunc_config.pyi
0.716 KB
20 Jan 2026 1.01 PM
root / root
0644
ufunclike.pyi
0.663 KB
20 Jan 2026 1.01 PM
root / root
0644
ufuncs.pyi
1.315 KB
20 Jan 2026 1.01 PM
root / root
0644
warnings_and_errors.pyi
0.17 KB
20 Jan 2026 1.01 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF