Import from collections.abc wherever possible (#7635)

This commit is contained in:
Alex Waygood
2022-04-18 11:50:37 +01:00
committed by GitHub
parent a17b3afb16
commit 97a74bc1aa
230 changed files with 449 additions and 348 deletions

View File

@@ -1,4 +1,5 @@
from typing import Any, Callable, Union
from collections.abc import Callable
from typing import Any, Union
from typing_extensions import TypeAlias
_Macro: TypeAlias = Union[tuple[str], tuple[str, str | None]]

View File

@@ -1,6 +1,7 @@
from abc import abstractmethod
from collections.abc import Callable, Iterable
from distutils.dist import Distribution
from typing import Any, Callable, Iterable
from typing import Any
class Command:
sub_commands: list[tuple[str, Callable[[Command], bool] | None]]

View File

@@ -1,7 +1,8 @@
from collections.abc import Mapping
from distutils.cmd import Command as Command
from distutils.dist import Distribution as Distribution
from distutils.extension import Extension as Extension
from typing import Any, Mapping
from typing import Any
def setup(
*,

View File

@@ -1,6 +1,7 @@
from _typeshed import StrOrBytesPath, SupportsWrite
from collections.abc import Iterable, Mapping
from distutils.cmd import Command
from typing import IO, Any, Iterable, Mapping
from typing import IO, Any
class DistributionMetadata:
def __init__(self, path: int | StrOrBytesPath | None = ...) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, Iterable, Mapping, overload
from collections.abc import Iterable, Mapping
from typing import Any, overload
from typing_extensions import TypeAlias
_Option: TypeAlias = tuple[str, str | None, str]

View File

@@ -1,4 +1,4 @@
from typing import Sequence
from collections.abc import Sequence
def copy_file(
src: str,

View File

@@ -1,4 +1,5 @@
from typing import Iterable, Pattern, overload
from collections.abc import Iterable
from typing import Pattern, overload
from typing_extensions import Literal
# class is entirely undocumented

View File

@@ -1,5 +1,5 @@
from collections.abc import Mapping
from distutils.ccompiler import CCompiler
from typing import Mapping
PREFIX: str
EXEC_PREFIX: str