mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
Import from collections.abc wherever possible (#7635)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Mapping, Sequence
|
||||
from importlib.abc import Loader
|
||||
from types import ModuleType
|
||||
from typing import Mapping, Sequence
|
||||
|
||||
__all__ = ["__import__", "import_module", "invalidate_caches", "reload"]
|
||||
|
||||
|
||||
@@ -10,9 +10,10 @@ from _typeshed import (
|
||||
StrPath,
|
||||
)
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Iterator, Mapping, Sequence
|
||||
from importlib.machinery import ModuleSpec
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
|
||||
from typing import IO, Any, BinaryIO, Iterator, Mapping, NoReturn, Protocol, Sequence, overload, runtime_checkable
|
||||
from typing import IO, Any, BinaryIO, NoReturn, Protocol, overload, runtime_checkable
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
_Path: TypeAlias = bytes | str
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import importlib.abc
|
||||
import sys
|
||||
import types
|
||||
from typing import Any, Callable, Iterable, Sequence
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from importlib.metadata import DistributionFinder, PathDistribution
|
||||
|
||||
@@ -2,12 +2,12 @@ import abc
|
||||
import pathlib
|
||||
import sys
|
||||
from _typeshed import Self, StrPath
|
||||
from collections.abc import Mapping
|
||||
from collections.abc import Iterable, Mapping
|
||||
from email.message import Message
|
||||
from importlib.abc import MetaPathFinder
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Any, ClassVar, Iterable, NamedTuple, Pattern, overload
|
||||
from typing import Any, ClassVar, NamedTuple, Pattern, overload
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
__all__ = [
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Iterator, Protocol, TypeVar
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, Protocol, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import os
|
||||
import sys
|
||||
from collections.abc import Iterator
|
||||
from contextlib import AbstractContextManager
|
||||
from pathlib import Path
|
||||
from types import ModuleType
|
||||
from typing import Any, BinaryIO, Iterator, TextIO
|
||||
from typing import Any, BinaryIO, TextIO
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
|
||||
@@ -3,7 +3,8 @@ import importlib.machinery
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
Reference in New Issue
Block a user