summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2022-06-03 18:55:38 -0700
committerSebastian Berg <sebastian@sipsolutions.net>2022-06-15 11:42:02 -0700
commitdc541a8565da9f14f30a3424ae93259b514f8997 (patch)
treea96b5912201fee744a4d2f84bef6e00fc5d37182
parent1b832839b8e73a02d552df2b964018336050d965 (diff)
downloadnumpy-dc541a8565da9f14f30a3424ae93259b514f8997.tar.gz
TYP: Add types for new symbols
Co-authored-by: Bas van Beek <b.f.van.beek@vu.nl>
-rw-r--r--numpy/__init__.pyi7
-rw-r--r--numpy/core/_ufunc_config.pyi2
2 files changed, 8 insertions, 1 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index 2eb4a0634..31e84f016 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -9,6 +9,7 @@ import enum
from abc import abstractmethod
from types import TracebackType, MappingProxyType
from contextlib import ContextDecorator
+from contextlib import contextmanager
if sys.version_info >= (3, 9):
from types import GenericAlias
@@ -180,6 +181,7 @@ from collections.abc import (
from typing import (
Literal as L,
Any,
+ Generator,
Generic,
IO,
NoReturn,
@@ -3351,6 +3353,11 @@ class errstate(Generic[_CallType], ContextDecorator):
/,
) -> None: ...
+@contextmanager
+def no_nep50_warning() -> Generator[None, None, None]: ...
+def get_promotion_state() -> str: ...
+def set_promotion_state(state: str, /) -> None: ...
+
class ndenumerate(Generic[_ScalarType]):
iter: flatiter[NDArray[_ScalarType]]
@overload
diff --git a/numpy/core/_ufunc_config.pyi b/numpy/core/_ufunc_config.pyi
index b7c2ebefc..76177f6b3 100644
--- a/numpy/core/_ufunc_config.pyi
+++ b/numpy/core/_ufunc_config.pyi
@@ -34,4 +34,4 @@ def seterrcall(
) -> None | _ErrFunc | _SupportsWrite[str]: ...
def geterrcall() -> None | _ErrFunc | _SupportsWrite[str]: ...
-# See `numpy/__init__.pyi` for the `errstate` class
+# See `numpy/__init__.pyi` for the `errstate` class and `no_nep5_warnings` \ No newline at end of file