Skip to content

Commit cd4d6ba

Browse files
authored
Merge pull request numpy#27520 from jorenham/typing/remove-unused-imports
TYP: Remove unused imports in the stubs
2 parents ed9ca2a + 219b5fd commit cd4d6ba

File tree

8 files changed

+1
-19
lines changed

8 files changed

+1
-19
lines changed

numpy/__init__.pyi

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ from numpy._typing import (
2020
# Arrays
2121
ArrayLike,
2222
NDArray,
23-
_ArrayLike,
2423
_SupportsArray,
2524
_NestedSequence,
2625
_FiniteNestedSequence,
@@ -40,7 +39,6 @@ from numpy._typing import (
4039
DTypeLike,
4140
_DTypeLike,
4241
_DTypeLikeVoid,
43-
_SupportsDType,
4442
_VoidDTypeLike,
4543

4644
# Shapes
@@ -195,7 +193,6 @@ from collections.abc import (
195193
from typing import (
196194
Literal as L,
197195
Any,
198-
Generator,
199196
NoReturn,
200197
SupportsComplex,
201198
SupportsFloat,
@@ -229,7 +226,6 @@ from numpy import (
229226
testing,
230227
typing,
231228
version,
232-
exceptions,
233229
dtypes,
234230
rec,
235231
char,

numpy/_typing/_callable.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ See the `Mypy documentation`_ on protocols for more details.
88
99
"""
1010

11-
from __future__ import annotations
12-
1311
from typing import (
1412
TypeAlias,
1513
TypeVar,

numpy/ctypeslib.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ from numpy import (
2525
intc,
2626
long,
2727
longlong,
28-
intp,
2928
ubyte,
3029
ushort,
3130
uintc,
3231
ulong,
3332
ulonglong,
34-
uintp,
3533
single,
3634
double,
3735
longdouble,

numpy/lib/_npyio_impl.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import sys
32
import zipfile
43
import types
54
from re import Pattern
@@ -17,7 +16,6 @@ from typing import (
1716
from typing_extensions import deprecated
1817

1918
from numpy import (
20-
ndarray,
2119
recarray,
2220
dtype,
2321
generic,

numpy/lib/_type_check_impl.pyi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,18 @@ from numpy import (
1313
dtype,
1414
generic,
1515
floating,
16-
float64,
1716
complexfloating,
1817
integer,
1918
)
2019

2120
from numpy._typing import (
2221
ArrayLike,
23-
DTypeLike,
2422
NBitBase,
2523
NDArray,
2624
_64Bit,
2725
_SupportsDType,
2826
_ScalarLike_co,
2927
_ArrayLike,
30-
_DTypeLikeComplex,
3128
)
3229

3330
__all__ = [

numpy/linalg/_linalg.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ from typing import (
88
SupportsIndex,
99
SupportsInt,
1010
NamedTuple,
11-
Generic,
1211
)
1312

1413
import numpy as np
@@ -82,7 +81,6 @@ __all__ = [
8281

8382
_T = TypeVar("_T")
8483
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
85-
_SCT = TypeVar("_SCT", bound=generic, covariant=True)
8684
_SCT2 = TypeVar("_SCT2", bound=generic, covariant=True)
8785

8886
_2Tuple: TypeAlias = tuple[_T, _T]

numpy/random/_generator.pyi

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ from numpy._typing import (
2525
_ArrayLikeInt_co,
2626
_DoubleCodes,
2727
_DTypeLikeBool,
28-
_DTypeLikeInt,
29-
_DTypeLikeUInt,
3028
_Float32Codes,
3129
_Float64Codes,
3230
_FloatLike_co,

numpy/version.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import sys
2-
from typing import Final, TypeAlias
1+
from typing import Final
32

43
from typing_extensions import LiteralString
54

0 commit comments

Comments
 (0)