diff options
Diffstat (limited to 'numpy/exceptions.pyi')
-rw-r--r-- | numpy/exceptions.pyi | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/numpy/exceptions.pyi b/numpy/exceptions.pyi index 53b7a0c16..c76a0946b 100644 --- a/numpy/exceptions.pyi +++ b/numpy/exceptions.pyi @@ -1,8 +1,18 @@ -from numpy.exceptions import ( - ComplexWarning as ComplexWarning, - ModuleDeprecationWarning as ModuleDeprecationWarning, - VisibleDeprecationWarning as VisibleDeprecationWarning, - TooHardError as TooHardError, - AxisError as AxisError, -) +from typing import overload +__all__: list[str] + +class ComplexWarning(RuntimeWarning): ... +class ModuleDeprecationWarning(DeprecationWarning): ... +class VisibleDeprecationWarning(UserWarning): ... +class TooHardError(RuntimeError): ... +class DTypePromotionError(TypeError): ... + +class AxisError(ValueError, IndexError): + axis: None | int + ndim: None | int + @overload + def __init__(self, axis: str, ndim: None = ..., msg_prefix: None = ...) -> None: ... + @overload + def __init__(self, axis: int, ndim: int, msg_prefix: None | str = ...) -> None: ... + def __str__(self) -> str: ... |