8000 WiP: Added type annotations for the ``np.core.fromnumeric`` module by BvB93 · Pull Request #59 · numpy/numpy-stubs · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

WiP: Added type annotations for the np.core.fromnumeric module #59

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Annotate using Python 2 compatible type comments
  • Loading branch information
Bas van Beek committed Apr 18, 2020
commit ba767a03c8ed4532d2f80cc1997c0a33576272e4
16 changes: 8 additions & 8 deletions tests/pass/warnings_and_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

import numpy as np

warnings: types.ModuleType = np.warnings
ModuleDeprecationWarning: Type[DeprecationWarning] = np.ModuleDeprecationWarning
VisibleDeprecationWarning: Type[UserWarning] = np.VisibleDeprecationWarning
ComplexWarning: Type[RuntimeWarning] = np.ComplexWarning
RankWarning: Type[UserWarning] = np.RankWarning
warnings = np.warnings # type: types.ModuleType
ModuleDeprecationWarning = np.ModuleDeprecationWarning # type: Type[DeprecationWarning]
VisibleDeprecationWarning = np.VisibleDeprecationWarning # type: Type[UserWarning]
ComplexWarning = np.ComplexWarning # type: Type[RuntimeWarning]
RankWarning = np.RankWarning # type: Type[UserWarning]

TooHardError: Type[RuntimeError] = np.TooHardError
AxisError1: Type[ValueError] = np.AxisError
AxisError2: Type[IndexError] = np.AxisError
TooHardError = np.TooHardError # type: Type[RuntimeError]
AxisError1 = np.AxisError # type: Type[ValueError]
AxisError2 = np.AxisError # type: Type[IndexError]

np.AxisError(1)
np.AxisError(1, ndim=2)
Expand Down
0