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

@@ -2,7 +2,8 @@ import socket
import sys
import types
from _typeshed import Self
from typing import Any, Iterable, Union
from collections.abc import Iterable
from typing import Any, Union
from typing_extensions import SupportsIndex, TypeAlias
__all__ = ["Client", "Listener", "Pipe", "wait"]

View File

@@ -1,8 +1,9 @@
import array
import threading
import weakref
from collections.abc import Callable, Iterable, Mapping, Sequence
from queue import Queue as Queue
from typing import Any, Callable, Iterable, Mapping, Sequence
from typing import Any
from typing_extensions import Literal
from .connection import Pipe as Pipe

View File

@@ -2,8 +2,9 @@ import queue
import sys
import threading
from _typeshed import Self
from collections.abc import Callable, Iterable, Mapping, Sequence
from types import TracebackType
from typing import Any, AnyStr, Callable, Generic, Iterable, Mapping, Sequence, TypeVar
from typing import Any, AnyStr, Generic, TypeVar
from .connection import Connection
from .context import BaseContext

View File

@@ -1,7 +1,8 @@
import sys
from _typeshed import Self
from collections.abc import Callable, Iterable, Iterator, Mapping
from types import TracebackType
from typing import Any, Callable, Generic, Iterable, Iterator, Mapping, TypeVar
from typing import Any, Generic, TypeVar
from typing_extensions import Literal
if sys.version_info >= (3, 9):

View File

@@ -1,6 +1,7 @@
import sys
from _typeshed import Self
from typing import Any, Generic, Iterable, TypeVar
from collections.abc import Iterable
from typing import Any, Generic, TypeVar
if sys.version_info >= (3, 9):
from types import GenericAlias

View File

@@ -1,5 +1,6 @@
from collections.abc import Mapping, Sequence
from types import ModuleType
from typing import Any, Mapping, Sequence
from typing import Any
__all__ = [
"_main",

View File

@@ -1,9 +1,10 @@
import sys
import threading
from collections.abc import Callable
from contextlib import AbstractContextManager
from multiprocessing.context import BaseContext
from types import TracebackType
from typing import Any, Callable
from typing import Any
from typing_extensions import TypeAlias
__all__ = ["Lock", "RLock", "Semaphore", "BoundedSemaphore", "Condition", "Event"]