Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
TYP: Modify typing stubs for new np.exceptions module
  • Loading branch information
seberg committed Nov 30, 2022
commit 86029d0188e371d70b90d224c3f0061997f86fc5
1 change: 1 addition & 0 deletions numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ from typing import (
# Ensures that the stubs are picked up
from numpy import (
ctypeslib as ctypeslib,
exceptions as exceptions,
fft as fft,
lib as lib,
linalg as linalg,
Expand Down
1 change: 1 addition & 0 deletions numpy/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# TODO: One day, we should remove the _set_module here before removing them
# fully. Not doing it now, just to allow unpickling to work on older
# versions for a bit. (Module exists since NumPy 1.25.)
# This then also means that the typing stubs should be moved!


@_set_module('numpy')
Expand Down
8 changes: 8 additions & 0 deletions numpy/exceptions.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from numpy.exceptions import (
ComplexWarning as ComplexWarning,
ModuleDeprecationWarning as ModuleDeprecationWarning,
VisibleDeprecationWarning as VisibleDeprecationWarning,
TooHardError as TooHardError,
AxisError as AxisError,
)