diff --git a/numpy-stubs/__init__.pyi b/numpy-stubs/__init__.pyi index 53dc39e..fc5c961 100644 --- a/numpy-stubs/__init__.pyi +++ b/numpy-stubs/__init__.pyi @@ -571,7 +571,10 @@ def isclose( def array_equal(a1: _ArrayLike, a2: _ArrayLike) -> bool: ... def array_equiv(a1: _ArrayLike, a2: _ArrayLike) -> bool: ... -# Numerical constants +# +# Constants +# + Inf: float Infinity: float NAN: float @@ -587,5 +590,33 @@ infty: float nan: float pi: float +ALLOW_THREADS: int +BUFSIZE: int +CLIP: int +ERR_CALL: int +ERR_DEFAULT: int +ERR_IGNORE: int +ERR_LOG: int +ERR_PRINT: int +ERR_RAISE: int +ERR_WARN: int +FLOATING_POINT_SUPPORT: int +FPE_DIVIDEBYZERO: int +FPE_INVALID: int +FPE_OVERFLOW: int +FPE_UNDERFLOW: int +MAXDIMS: int +MAY_SHARE_BOUNDS: int +MAY_SHARE_EXACT: int +RAISE: int +SHIFT_DIVIDEBYZERO: int +SHIFT_INVALID: int +SHIFT_OVERFLOW: int +SHIFT_UNDERFLOW: int +UFUNC_BUFSIZE_DEFAULT: int +WRAP: int +little_endian: int +tracemalloc_domain: int + # TODO(shoyer): remove when the full numpy namespace is defined def __getattr__(name: str) -> Any: ... diff --git a/tests/reveal/constants.py b/tests/reveal/constants.py index 67ee9b3..8e00810 100644 --- a/tests/reveal/constants.py +++ b/tests/reveal/constants.py @@ -14,3 +14,31 @@ reveal_type(np.infty) # E: float reveal_type(np.nan) # E: float reveal_type(np.pi) # E: float + +reveal_type(np.ALLOW_THREADS) # E: int +reveal_type(np.BUFSIZE) # E: int +reveal_type(np.CLIP) # E: int +reveal_type(np.ERR_CALL) # E: int +reveal_type(np.ERR_DEFAULT) # E: int +reveal_type(np.ERR_IGNORE) # E: int +reveal_type(np.ERR_LOG) # E: int +reveal_type(np.ERR_PRINT) # E: int +reveal_type(np.ERR_RAISE) # E: int +reveal_type(np.ERR_WARN) # E: int +reveal_type(np.FLOATING_POINT_SUPPORT) # E: int +reveal_type(np.FPE_DIVIDEBYZERO) # E: int +reveal_type(np.FPE_INVALID) # E: int +reveal_type(np.FPE_OVERFLOW) # E: int +reveal_type(np.FPE_UNDERFLOW) # E: int +reveal_type(np.MAXDIMS) # E: int +reveal_type(np.MAY_SHARE_BOUNDS) # E: int +reveal_type(np.MAY_SHARE_EXACT) # E: int +reveal_type(np.RAISE) # E: int +reveal_type(np.SHIFT_DIVIDEBYZERO) # E: int +reveal_type(np.SHIFT_INVALID) # E: int +reveal_type(np.SHIFT_OVERFLOW) # E: int +reveal_type(np.SHIFT_UNDERFLOW) # E: int +reveal_type(np.UFUNC_BUFSIZE_DEFAULT) # E: int +reveal_type(np.WRAP) # E: int +reveal_type(np.little_endian) # E: int +reveal_type(np.tracemalloc_domain) # E: int