Skip to content

Commit 801bb24

Browse files
authored
TYP: Update typing for 3.10 (#61453)
* update typing for 3.10 * add 2 more TypeAlias * add 2 more TypeAlias * fix hook for stubtest - make it work on Windows. remove combine from nattype.pyi
1 parent 6879598 commit 801bb24

22 files changed

+177
-180
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ repos:
140140
pass_filenames: false
141141
types: [python]
142142
stages: [manual]
143-
- id: mypy
143+
- id: stubtest
144144
# note: assumes python env is setup and activated
145145
# note: requires pandas dev to be installed
146146
name: mypy (stubtest)

pandas/_libs/arrays.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Sequence
1+
from collections.abc import Sequence
22

33
import numpy as np
44

pandas/_libs/hashtable.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Hashable
12
from typing import (
23
Any,
3-
Hashable,
44
Literal,
55
overload,
66
)

pandas/_libs/internals.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
from typing import (
1+
from collections.abc import (
22
Iterator,
33
Sequence,
4+
)
5+
from typing import (
46
final,
57
overload,
68
)

pandas/_libs/json.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from collections.abc import Callable
12
from typing import (
23
Any,
3-
Callable,
44
)
55

66
def ujson_dumps(

pandas/_libs/lib.pyi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# TODO(npdtypes): Many types specified here can be made more specific/accurate;
22
# the more specific versions are specified in comments
3+
from collections.abc import (
4+
Callable,
5+
Generator,
6+
Hashable,
7+
)
38
from decimal import Decimal
49
from typing import (
510
Any,
6-
Callable,
711
Final,
8-
Generator,
9-
Hashable,
1012
Literal,
1113
TypeAlias,
1214
overload,

pandas/_libs/ops.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
from typing import (
2-
Any,
1+
from collections.abc import (
32
Callable,
43
Iterable,
4+
)
5+
from typing import (
6+
Any,
57
Literal,
68
TypeAlias,
79
overload,

pandas/_libs/parsers.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Hashable
12
from typing import (
2-
Hashable,
33
Literal,
44
)
55

pandas/_libs/properties.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
from collections.abc import Sequence
12
from typing import (
2-
Sequence,
33
overload,
44
)
55

pandas/_libs/sparse.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Sequence
1+
from collections.abc import Sequence
22

33
import numpy as np
44

0 commit comments

Comments
 (0)