Skip to content

Commit 97a74bc

Browse files
authored
Import from collections.abc wherever possible (#7635)
1 parent a17b3af commit 97a74bc

File tree

230 files changed

+445
-344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+445
-344
lines changed

stdlib/_bisect.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
from _typeshed import SupportsRichComparisonT
3-
from typing import Callable, MutableSequence, Sequence, TypeVar, overload
3+
from collections.abc import Callable, MutableSequence, Sequence
4+
from typing import TypeVar, overload
45

56
_T = TypeVar("_T")
67

stdlib/_codecs.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import codecs
22
import sys
3-
from typing import Any, Callable
3+
from collections.abc import Callable
4+
from typing import Any
45
from typing_extensions import TypeAlias
56

67
# This type is not exposed; it is defined in unicodeobject.c

stdlib/_compression.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from _typeshed import WriteableBuffer
2+
from collections.abc import Callable
23
from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase
3-
from typing import Any, Callable, Protocol
4+
from typing import Any, Protocol
45

56
BUFFER_SIZE = DEFAULT_BUFFER_SIZE
67

stdlib/_csv.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Any, Iterable, Iterator, Protocol, Union
1+
from collections.abc import Iterable, Iterator
2+
from typing import Any, Protocol, Union
23
from typing_extensions import Literal, TypeAlias
34

45
__version__: str

stdlib/_decimal.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import numbers
22
import sys
33
from _typeshed import Self
4+
from collections.abc import Container, Sequence
45
from types import TracebackType
5-
from typing import Any, Container, NamedTuple, Sequence, Union, overload
6+
from typing import Any, NamedTuple, Union, overload
67
from typing_extensions import TypeAlias
78

89
_Decimal: TypeAlias = Decimal | int

stdlib/_dummy_thread.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from collections.abc import Callable
12
from types import TracebackType
2-
from typing import Any, Callable, NoReturn
3+
from typing import Any, NoReturn
34

45
TIMEOUT_MAX: int
56
error = RuntimeError

stdlib/_dummy_threading.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
2+
from collections.abc import Callable, Iterable, Mapping
23
from types import FrameType, TracebackType
3-
from typing import Any, Callable, Iterable, Mapping, TypeVar
4+
from typing import Any, TypeVar
45
from typing_extensions import TypeAlias
56

67
# TODO recursive type

stdlib/_json.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Any, Callable
1+
from collections.abc import Callable
2+
from typing import Any
23
from typing_extensions import final
34

45
@final

stdlib/_operator.pyi

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
import sys
2-
from typing import (
3-
Any,
4-
AnyStr,
5-
Callable,
6-
Container,
7-
Generic,
8-
Iterable,
9-
Mapping,
10-
MutableMapping,
11-
MutableSequence,
12-
Protocol,
13-
Sequence,
14-
SupportsAbs,
15-
TypeVar,
16-
overload,
17-
)
2+
from collections.abc import Callable, Container, Iterable, Mapping, MutableMapping, MutableSequence, Sequence
3+
from typing import Any, AnyStr, Generic, Protocol, SupportsAbs, TypeVar, overload
184
from typing_extensions import ParamSpec, SupportsIndex, TypeAlias, final
195

206
_R = TypeVar("_R")

stdlib/_osx_support.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
2-
from typing import Iterable, Sequence, TypeVar
2+
from collections.abc import Iterable, Sequence
3+
from typing import TypeVar
34

45
_T = TypeVar("_T")
56
_K = TypeVar("_K")

0 commit comments

Comments
 (0)