Skip to content

Commit c274116

Browse files
MAINT: Optional[T] → T | None
Co-authored-by: Joren Hammudoglu <[email protected]>
1 parent 295df1a commit c274116

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

numpy/core/_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import warnings
2-
from typing import Optional
32

43

5-
def _raise_warning(attr: str, submodule: Optional[str] = None) -> None:
4+
def _raise_warning(attr: str, submodule: str | None = None) -> None:
65
new_module = "numpy._core"
76
old_module = "numpy.core"
87
if submodule is not None:

numpy/lib/_function_base_impl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
# needed in this module for compatibility
3232
from numpy.lib._histograms_impl import histogram, histogramdd # noqa: F401
33-
from typing import Optional
3433

3534

3635
array_function_dispatch = functools.partial(
@@ -4666,7 +4665,7 @@ def _quantile_ureduce_func(
46664665
a: np.array,
46674666
q: np.array,
46684667
weights: np.array,
4669-
axis: Optional[int] = None,
4668+
axis: int | None = None,
46704669
out=None,
46714670
overwrite_input: bool = False,
46724671
method="linear",

numpy/lib/_nanfunctions_impl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
from numpy.lib import _function_base_impl as fnb
2828
from numpy.lib._function_base_impl import _weights_are_valid
2929
from numpy._core import overrides
30-
from typing import Optional
3130

3231

3332
array_function_dispatch = functools.partial(
@@ -1663,7 +1662,7 @@ def _nanquantile_ureduce_func(
16631662
a: np.array,
16641663
q: np.array,
16651664
weights: np.array,
1666-
axis: Optional[int] = None,
1665+
axis: int | None = None,
16671666
out=None,
16681667
overwrite_input: bool = False,
16691668
method="linear",

0 commit comments

Comments
 (0)