Skip to content

Commit 63dc4c9

Browse files
authored
TYP: fix missing sys import in numeric.pyi (numpy#26788)
* fix missing `sys` import in numeric.pyi * remove sys.version_info >= (3, 10) check in .pyi As 3.10 now is the minimum required version for numpy * remove in numeric.pyi an imported symbol missing after c8e2343 It's okay to just remove it as it wasn't really used in the code either way.
1 parent 594657d commit 63dc4c9

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

numpy/_core/numeric.pyi

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@ from typing import (
77
SupportsAbs,
88
SupportsIndex,
99
NoReturn,
10+
TypeGuard,
1011
)
11-
if sys.version_info >= (3, 10):
12-
from typing import TypeGuard
13-
else:
14-
from typing_extensions import TypeGuard
1512

1613
import numpy as np
1714
from numpy import (
18-
ComplexWarning as ComplexWarning,
1915
generic,
2016
unsignedinteger,
2117
signedinteger,

numpy/lib/_function_base_impl.pyi

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sys
21
from collections.abc import Sequence, Iterator, Callable, Iterable
32
from typing import (
43
Literal as L,
@@ -8,13 +7,9 @@ from typing import (
87
Protocol,
98
SupportsIndex,
109
SupportsInt,
10+
TypeGuard
1111
)
1212

13-
if sys.version_info >= (3, 10):
14-
from typing import TypeGuard
15-
else:
16-
from typing_extensions import TypeGuard
17-
1813
from numpy import (
1914
vectorize as vectorize,
2015
ufunc,

numpy/lib/_shape_base_impl.pyi

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import sys
21
from collections.abc import Callable, Sequence
3-
from typing import TypeVar, Any, overload, SupportsIndex, Protocol
4-
5-
if sys.version_info >= (3, 10):
6-
from typing import ParamSpec, Concatenate
7-
else:
8-
from typing_extensions import ParamSpec, Concatenate
2+
from typing import (
3+
TypeVar,
4+
Any,
5+
overload,
6+
SupportsIndex,
7+
Protocol,
8+
ParamSpec,
9+
Concatenate,
10+
)
911

1012
import numpy as np
1113
from numpy import (

numpy/testing/_private/utils.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,8 @@ from typing import (
1818
TypeVar,
1919
Final,
2020
SupportsIndex,
21+
ParamSpec
2122
)
22-
if sys.version_info >= (3, 10):
23-
from typing import ParamSpec
24-
else:
25-
from typing_extensions import ParamSpec
2623

2724
import numpy as np
2825
from numpy import number, object_, _FloatValue

0 commit comments

Comments
 (0)