mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-17 08:35:03 +08:00
Import from collections.abc wherever possible (#7635)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import SupportsRichComparisonT
|
||||
from typing import Callable, MutableSequence, Sequence, TypeVar, overload
|
||||
from collections.abc import Callable, MutableSequence, Sequence
|
||||
from typing import TypeVar, overload
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import codecs
|
||||
import sys
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# This type is not exposed; it is defined in unicodeobject.c
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _typeshed import WriteableBuffer
|
||||
from collections.abc import Callable
|
||||
from io import DEFAULT_BUFFER_SIZE, BufferedIOBase, RawIOBase
|
||||
from typing import Any, Callable, Protocol
|
||||
from typing import Any, Protocol
|
||||
|
||||
BUFFER_SIZE = DEFAULT_BUFFER_SIZE
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Iterable, Iterator, Protocol, Union
|
||||
from collections.abc import Iterable, Iterator
|
||||
from typing import Any, Protocol, Union
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
__version__: str
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import numbers
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Container, Sequence
|
||||
from types import TracebackType
|
||||
from typing import Any, Container, NamedTuple, Sequence, Union, overload
|
||||
from typing import Any, NamedTuple, Union, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_Decimal: TypeAlias = Decimal | int
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from collections.abc import Callable
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, NoReturn
|
||||
from typing import Any, NoReturn
|
||||
|
||||
TIMEOUT_MAX: int
|
||||
error = RuntimeError
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from collections.abc import Callable, Iterable, Mapping
|
||||
from types import FrameType, TracebackType
|
||||
from typing import Any, Callable, Iterable, Mapping, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# TODO recursive type
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
from typing_extensions import final
|
||||
|
||||
@final
|
||||
|
||||
@@ -1,20 +1,6 @@
|
||||
import sys
|
||||
from typing import (
|
||||
Any,
|
||||
AnyStr,
|
||||
Callable,
|
||||
Container,
|
||||
Generic,
|
||||
Iterable,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
MutableSequence,
|
||||
Protocol,
|
||||
Sequence,
|
||||
SupportsAbs,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from collections.abc import Callable, Container, Iterable, Mapping, MutableMapping, MutableSequence, Sequence
|
||||
from typing import Any, AnyStr, Generic, Protocol, SupportsAbs, TypeVar, overload
|
||||
from typing_extensions import ParamSpec, SupportsIndex, TypeAlias, final
|
||||
|
||||
_R = TypeVar("_R")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Iterable, Sequence, TypeVar
|
||||
from collections.abc import Iterable, Sequence
|
||||
from typing import TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_K = TypeVar("_K")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Callable, Sequence
|
||||
from collections.abc import Callable, Sequence
|
||||
|
||||
if sys.platform != "win32":
|
||||
def cloexec_pipe() -> tuple[int, int]: ...
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import ClassVar, Iterable, NoReturn
|
||||
from collections.abc import Iterable
|
||||
from typing import ClassVar, NoReturn
|
||||
from typing_extensions import Literal
|
||||
|
||||
class Quitter:
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import sys
|
||||
from _typeshed import structseq
|
||||
from collections.abc import Callable
|
||||
from threading import Thread
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, NoReturn
|
||||
from typing import Any, NoReturn
|
||||
from typing_extensions import Final, final
|
||||
|
||||
error = RuntimeError
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from collections.abc import Sequence
|
||||
from tracemalloc import _FrameTupleT, _TraceTupleT
|
||||
from typing import Sequence
|
||||
|
||||
def _get_object_traceback(__obj: object) -> Sequence[_FrameTupleT] | None: ...
|
||||
def _get_traces() -> Sequence[_TraceTupleT]: ...
|
||||
|
||||
@@ -6,9 +6,10 @@ import array
|
||||
import ctypes
|
||||
import mmap
|
||||
import sys
|
||||
from collections.abc import Awaitable, Container, Iterable, Set as AbstractSet
|
||||
from os import PathLike
|
||||
from types import TracebackType
|
||||
from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, TypeVar, Union
|
||||
from typing import Any, Generic, Protocol, TypeVar, Union
|
||||
from typing_extensions import Final, Literal, TypeAlias, final
|
||||
|
||||
_KT = TypeVar("_KT")
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
import sys
|
||||
from _typeshed import OptExcInfo
|
||||
from typing import Any, Callable, Iterable, Protocol
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, Protocol
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
class _Readable(Protocol):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Generic, TypeVar, overload
|
||||
from collections.abc import Callable
|
||||
from typing import Any, Generic, TypeVar, overload
|
||||
from typing_extensions import final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, Generic, Iterable, Iterator, MutableSet, TypeVar
|
||||
from collections.abc import Iterable, Iterator, MutableSet
|
||||
from typing import Any, Generic, TypeVar
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, NoReturn, Sequence, overload
|
||||
from collections.abc import Sequence
|
||||
from typing import Any, NoReturn, overload
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
import sys
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
Callable,
|
||||
Generator,
|
||||
Generic,
|
||||
Iterable,
|
||||
NewType,
|
||||
NoReturn,
|
||||
Pattern,
|
||||
Protocol,
|
||||
Sequence,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from collections.abc import Callable, Generator, Iterable, Sequence
|
||||
from typing import IO, Any, Generic, NewType, NoReturn, Pattern, Protocol, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, TypeVar, overload
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, BinaryIO, Generic, MutableSequence, TypeVar, overload
|
||||
from typing_extensions import Literal, SupportsIndex, TypeAlias
|
||||
|
||||
_IntTypeCode: TypeAlias = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _ast import *
|
||||
from typing import Any, Iterator, TypeVar, overload
|
||||
from collections.abc import Iterator
|
||||
from typing import Any, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
|
||||
@@ -6,9 +6,9 @@ from asyncio.futures import Future
|
||||
from asyncio.protocols import BaseProtocol
|
||||
from asyncio.tasks import Task
|
||||
from asyncio.transports import BaseTransport, ReadTransport, SubprocessTransport, WriteTransport
|
||||
from collections.abc import Iterable
|
||||
from collections.abc import Awaitable, Callable, Coroutine, Generator, Iterable, Sequence
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Awaitable, Callable, Coroutine, Generator, Sequence, TypeVar, overload
|
||||
from typing import IO, Any, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, Callable, Sequence
|
||||
from collections.abc import Callable, Sequence
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import subprocess
|
||||
from collections import deque
|
||||
from typing import IO, Any, Callable, Sequence
|
||||
from collections.abc import Callable, Sequence
|
||||
from typing import IO, Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import events, futures, protocols, transports
|
||||
|
||||
@@ -2,8 +2,9 @@ import ssl
|
||||
import sys
|
||||
from _typeshed import FileDescriptorLike, Self
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Awaitable, Callable, Coroutine, Generator, Sequence
|
||||
from socket import AddressFamily, SocketKind, _Address, _RetAddress, socket
|
||||
from typing import IO, Any, Awaitable, Callable, Coroutine, Generator, Sequence, TypeVar, overload
|
||||
from typing import IO, Any, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from .base_events import Server
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import functools
|
||||
import traceback
|
||||
from collections.abc import Iterable
|
||||
from types import FrameType, FunctionType
|
||||
from typing import Any, Iterable, overload
|
||||
from typing import Any, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
class _HasWrapper:
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Awaitable, Callable, Generator, Iterable
|
||||
from concurrent.futures._base import Error, Future as _ConcurrentFuture
|
||||
from typing import Any, Awaitable, Callable, Generator, Iterable, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Literal, TypeGuard
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from collections import deque
|
||||
from collections.abc import Callable, Generator
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Generator, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from collections.abc import Mapping
|
||||
from socket import socket
|
||||
from typing import Any, Mapping, Protocol
|
||||
from typing import Any, Protocol
|
||||
from typing_extensions import Literal
|
||||
|
||||
from . import base_events, constants, events, futures, streams, transports
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Awaitable, TypeVar
|
||||
from collections.abc import Awaitable
|
||||
from typing import TypeVar
|
||||
|
||||
__all__ = ("run",)
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import ssl
|
||||
import sys
|
||||
from collections import deque
|
||||
from typing import Any, Callable, ClassVar
|
||||
from collections.abc import Callable
|
||||
from typing import Any, ClassVar
|
||||
from typing_extensions import Literal
|
||||
|
||||
from . import constants, events, futures, protocols, transports
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Awaitable, Callable, Iterable
|
||||
from collections.abc import Awaitable, Callable, Iterable
|
||||
from typing import Any
|
||||
|
||||
from . import events
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrPath
|
||||
from typing import Any, AsyncIterator, Awaitable, Callable, Iterable, Sequence
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from . import events, protocols, transports
|
||||
|
||||
@@ -2,7 +2,8 @@ import subprocess
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from asyncio import events, protocols, streams, transports
|
||||
from typing import IO, Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import IO, Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# This only exists in 3.11+. See VERSIONS.
|
||||
|
||||
from _typeshed import Self
|
||||
from collections.abc import Coroutine, Generator
|
||||
from types import TracebackType
|
||||
from typing import Any, Coroutine, Generator, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from .tasks import Task
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import concurrent.futures
|
||||
import sys
|
||||
from collections.abc import Awaitable, Generator, Iterable, Iterator
|
||||
from collections.abc import Awaitable, Coroutine, Generator, Iterable, Iterator
|
||||
from types import FrameType
|
||||
from typing import Any, Coroutine, Generic, TextIO, TypeVar, overload
|
||||
from typing import Any, Generic, TextIO, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
from .events import AbstractEventLoop
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Callable, TypeVar
|
||||
from collections.abc import Callable
|
||||
from typing import TypeVar
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
__all__ = ("to_thread",)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import sys
|
||||
from asyncio.events import AbstractEventLoop
|
||||
from asyncio.protocols import BaseProtocol
|
||||
from collections.abc import Mapping
|
||||
from socket import _Address
|
||||
from typing import Any, Mapping
|
||||
from typing import Any
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
__all__ = ("BaseTransport", "ReadTransport", "WriteTransport", "Transport", "DatagramTransport", "SubprocessTransport")
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import socket
|
||||
import sys
|
||||
from builtins import type as Type # alias to avoid name clashes with property named "type"
|
||||
from collections.abc import Iterable
|
||||
from types import TracebackType
|
||||
from typing import Any, BinaryIO, Iterable, NoReturn, overload
|
||||
from typing import Any, BinaryIO, NoReturn, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# These are based in socket, maybe move them out into _typeshed.pyi or such
|
||||
|
||||
@@ -2,8 +2,9 @@ import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable
|
||||
from socket import socket
|
||||
from typing import Any, Callable
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
|
||||
from .base_events import Server
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import socket
|
||||
import sys
|
||||
from _typeshed import WriteableBuffer
|
||||
from typing import IO, Any, Callable, ClassVar, NoReturn
|
||||
from collections.abc import Callable
|
||||
from typing import IO, Any, ClassVar, NoReturn
|
||||
from typing_extensions import Literal
|
||||
|
||||
from . import events, futures, proactor_events, selector_events, streams, windows_utils
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import subprocess
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable
|
||||
from types import TracebackType
|
||||
from typing import Any, AnyStr, Callable, Protocol
|
||||
from typing import Any, AnyStr, Protocol
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Callable, TypeVar
|
||||
from collections.abc import Callable
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _typeshed import ExcInfo
|
||||
from collections.abc import Callable, Iterable, Mapping
|
||||
from types import CodeType, FrameType, TracebackType
|
||||
from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, TypeVar
|
||||
from typing import IO, Any, SupportsInt, TypeVar
|
||||
from typing_extensions import Literal, ParamSpec, TypeAlias
|
||||
|
||||
__all__ = ["BdbQuit", "Bdb", "Breakpoint"]
|
||||
|
||||
@@ -22,29 +22,31 @@ from _typeshed import (
|
||||
SupportsTrunc,
|
||||
SupportsWrite,
|
||||
)
|
||||
from collections.abc import Callable
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
|
||||
from types import CodeType, TracebackType, _Cell
|
||||
from typing import (
|
||||
IO,
|
||||
AbstractSet,
|
||||
Any,
|
||||
from collections.abc import (
|
||||
Awaitable,
|
||||
BinaryIO,
|
||||
ByteString,
|
||||
ClassVar,
|
||||
Generic,
|
||||
Callable,
|
||||
Iterable,
|
||||
Iterator,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
MutableSequence,
|
||||
MutableSet,
|
||||
Reversible,
|
||||
Set as AbstractSet,
|
||||
Sized,
|
||||
)
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
|
||||
from types import CodeType, TracebackType, _Cell
|
||||
from typing import (
|
||||
IO,
|
||||
Any,
|
||||
BinaryIO,
|
||||
ByteString,
|
||||
ClassVar,
|
||||
Generic,
|
||||
MutableSequence,
|
||||
NoReturn,
|
||||
Protocol,
|
||||
Reversible,
|
||||
Sequence,
|
||||
Sized,
|
||||
SupportsAbs,
|
||||
SupportsBytes,
|
||||
SupportsComplex,
|
||||
|
||||
@@ -2,7 +2,8 @@ import _compression
|
||||
import sys
|
||||
from _compression import BaseStream
|
||||
from _typeshed import ReadableBuffer, Self, StrOrBytesPath, WriteableBuffer
|
||||
from typing import IO, Any, Iterable, Protocol, TextIO, overload
|
||||
from collections.abc import Iterable
|
||||
from typing import IO, Any, Protocol, TextIO, overload
|
||||
from typing_extensions import Literal, SupportsIndex, TypeAlias, final
|
||||
|
||||
__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor", "open", "compress", "decompress"]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from collections.abc import Callable
|
||||
from types import CodeType
|
||||
from typing import Any, Callable, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import ParamSpec, TypeAlias
|
||||
|
||||
__all__ = ["run", "runctx", "Profile"]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _typeshed import OptExcInfo, StrOrBytesPath
|
||||
from collections.abc import Callable
|
||||
from types import FrameType, TracebackType
|
||||
from typing import IO, Any, Callable
|
||||
from typing import IO, Any
|
||||
|
||||
__UNDEF__: object # undocumented sentinel
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import IO, Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import IO, Any
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["Cmd"]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from codeop import CommandCompiler
|
||||
from collections.abc import Callable, Mapping
|
||||
from types import CodeType
|
||||
from typing import Any, Callable, Mapping
|
||||
from typing import Any
|
||||
|
||||
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"]
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@ import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from abc import abstractmethod
|
||||
from typing import IO, Any, BinaryIO, Callable, Generator, Iterable, Iterator, Protocol, TextIO, overload
|
||||
from collections.abc import Callable, Generator, Iterable, Iterator
|
||||
from typing import IO, Any, BinaryIO, Protocol, TextIO, overload
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -2,10 +2,10 @@ import sys
|
||||
import threading
|
||||
from _typeshed import Self
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Container, Iterable, Iterator, Sequence
|
||||
from collections.abc import Callable, Container, Iterable, Iterator, Sequence
|
||||
from logging import Logger
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Generic, Protocol, TypeVar, overload
|
||||
from typing import Any, Generic, Protocol, TypeVar, overload
|
||||
from typing_extensions import Literal, ParamSpec, SupportsIndex
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import sys
|
||||
from collections.abc import Generator, Iterable, Mapping, MutableMapping, MutableSequence
|
||||
from collections.abc import Callable, Generator, Iterable, Mapping, MutableMapping, MutableSequence
|
||||
from multiprocessing.connection import Connection
|
||||
from multiprocessing.context import BaseContext, Process
|
||||
from multiprocessing.queues import Queue, SimpleQueue
|
||||
from threading import Lock, Semaphore, Thread
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Generic, TypeVar
|
||||
from typing import Any, Generic, TypeVar
|
||||
from weakref import ref
|
||||
|
||||
from ._base import Executor, Future
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import queue
|
||||
import sys
|
||||
from collections.abc import Iterable, Mapping, Set as AbstractSet
|
||||
from collections.abc import Callable, Iterable, Mapping, Set as AbstractSet
|
||||
from threading import Lock, Semaphore, Thread
|
||||
from typing import Any, Callable, Generic, TypeVar
|
||||
from typing import Any, Generic, TypeVar
|
||||
from weakref import ref
|
||||
|
||||
from ._base import Executor, Future
|
||||
|
||||
@@ -1,21 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from collections.abc import AsyncGenerator, AsyncIterator, Awaitable, Callable, Generator, Iterator
|
||||
from types import TracebackType
|
||||
from typing import ( # noqa: Y027
|
||||
IO,
|
||||
Any,
|
||||
AsyncGenerator,
|
||||
AsyncIterator,
|
||||
Awaitable,
|
||||
Callable,
|
||||
ContextManager,
|
||||
Generator,
|
||||
Generic,
|
||||
Iterator,
|
||||
Protocol,
|
||||
TypeVar,
|
||||
overload,
|
||||
)
|
||||
from typing import IO, Any, ContextManager, Generic, Protocol, TypeVar, overload # noqa: Y027
|
||||
from typing_extensions import ParamSpec, TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, Callable, ClassVar, Generic, Iterator, Mapping, TypeVar, overload
|
||||
from collections.abc import Callable, Iterator, Mapping
|
||||
from typing import Any, ClassVar, Generic, TypeVar, overload
|
||||
from typing_extensions import ParamSpec, final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import Any, Callable, Hashable, SupportsInt, TypeVar, Union
|
||||
from collections.abc import Callable, Hashable
|
||||
from typing import Any, SupportsInt, TypeVar, Union
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, Self, WriteableBuffer
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Callable, ClassVar, Generic, Iterable, Iterator, Mapping, Sequence, TypeVar, Union as _UnionT, overload
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from typing import Any, ClassVar, Generic, TypeVar, Union as _UnionT, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, Callable, TypeVar
|
||||
from collections.abc import Callable
|
||||
from typing import Any, TypeVar
|
||||
|
||||
if sys.platform != "win32":
|
||||
from _curses import *
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
|
||||
if sys.platform != "win32":
|
||||
from _curses import _CursesWindow
|
||||
|
||||
@@ -2,7 +2,8 @@ import enum
|
||||
import sys
|
||||
import types
|
||||
from builtins import type as Type # alias to avoid name clashes with fields named "type"
|
||||
from typing import Any, Callable, Generic, Iterable, Mapping, Protocol, TypeVar, overload
|
||||
from collections.abc import Callable, Iterable, Mapping
|
||||
from typing import Any, Generic, Protocol, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterator, MutableMapping
|
||||
from types import TracebackType
|
||||
from typing import Iterator, MutableMapping
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
__all__ = ["open", "whichdb", "error"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterator, MutableMapping
|
||||
from types import TracebackType
|
||||
from typing import Iterator, MutableMapping
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = ["error", "open"]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, AnyStr, Callable, Generic, Iterable, Iterator, NamedTuple, Sequence, TypeVar, overload
|
||||
from collections.abc import Callable, Iterable, Iterator, Sequence
|
||||
from typing import Any, AnyStr, Generic, NamedTuple, TypeVar, overload
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from types import GenericAlias
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterator
|
||||
from opcode import * # `dis` re-exports it as a part of public API
|
||||
from typing import IO, Any, Callable, Iterator, NamedTuple
|
||||
from typing import IO, Any, NamedTuple
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -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]]
|
||||
|
||||
@@ -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]]
|
||||
|
||||
@@ -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(
|
||||
*,
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Sequence
|
||||
from collections.abc import Sequence
|
||||
|
||||
def copy_file(
|
||||
src: str,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from collections.abc import Mapping
|
||||
from distutils.ccompiler import CCompiler
|
||||
from typing import Mapping
|
||||
|
||||
PREFIX: str
|
||||
EXEC_PREFIX: str
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import types
|
||||
import unittest
|
||||
from _typeshed import ExcInfo
|
||||
from typing import Any, Callable, NamedTuple
|
||||
from collections.abc import Callable
|
||||
from typing import Any, NamedTuple
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from collections.abc import Callable
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
from typing import IO, Callable, TypeVar, Union
|
||||
from typing import IO, TypeVar, Union
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# Definitions imported by multiple submodules in typeshed
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from collections.abc import Iterable, Iterator
|
||||
from email.errors import HeaderParseError, MessageDefect
|
||||
from email.policy import Policy
|
||||
from typing import Any, Iterable, Iterator, Pattern
|
||||
from typing import Any, Pattern
|
||||
from typing_extensions import Final
|
||||
|
||||
WSP: Final[set[str]]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Iterator
|
||||
from collections.abc import Iterator
|
||||
|
||||
__all__ = ["Charset", "add_alias", "add_charset", "add_codec"]
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from collections.abc import Callable
|
||||
from email.message import Message
|
||||
from typing import Any, Callable
|
||||
from typing import Any
|
||||
|
||||
class ContentManager:
|
||||
def __init__(self) -> None: ...
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from collections.abc import Callable
|
||||
from email import _MessageT
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
from typing import Callable, Generic, overload
|
||||
from typing import Generic, overload
|
||||
|
||||
__all__ = ["FeedParser", "BytesFeedParser"]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from _typeshed import SupportsWrite
|
||||
from collections.abc import Iterator
|
||||
from email.message import Message
|
||||
from typing import Iterator
|
||||
|
||||
__all__ = ["body_line_iterator", "typed_subpart_iterator", "walk"]
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from collections.abc import Generator, Iterator, Sequence
|
||||
from email import _ParamsType, _ParamType
|
||||
from email.charset import Charset
|
||||
from email.contentmanager import ContentManager
|
||||
from email.errors import MessageDefect
|
||||
from email.policy import Policy
|
||||
from typing import Any, Generator, Iterator, Sequence, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = ["Message", "EmailMessage"]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import email.feedparser
|
||||
from collections.abc import Callable
|
||||
from email import _MessageT
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
from typing import BinaryIO, Callable, TextIO
|
||||
from typing import BinaryIO, TextIO
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = ["Parser", "HeaderParser", "BytesParser", "BytesHeaderParser", "FeedParser", "BytesFeedParser"]
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable
|
||||
from email.contentmanager import ContentManager
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
from email.message import Message
|
||||
from typing import Any, Callable
|
||||
from typing import Any
|
||||
|
||||
__all__ = ["Compat32", "compat32", "Policy", "EmailPolicy", "default", "strict", "SMTP", "HTTP"]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Mapping
|
||||
from collections.abc import Mapping
|
||||
|
||||
errorcode: Mapping[int, str]
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from collections.abc import Callable, Iterable, Sequence
|
||||
from os import PathLike
|
||||
from typing import Any, AnyStr, Callable, Generic, Iterable, Sequence
|
||||
from typing import Any, AnyStr, Generic
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import Self, StrOrBytesPath
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from types import TracebackType
|
||||
from typing import IO, Any, AnyStr, Callable, Generic, Iterable, Iterator
|
||||
from typing import IO, Any, AnyStr, Generic
|
||||
|
||||
__all__ = [
|
||||
"input",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import AnyStr, Iterable
|
||||
from collections.abc import Iterable
|
||||
from typing import AnyStr
|
||||
|
||||
__all__ = ["filter", "fnmatch", "fnmatchcase", "translate"]
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from typing import IO, Any, Iterable
|
||||
from collections.abc import Iterable
|
||||
from typing import IO, Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
AS_IS: None
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import sys
|
||||
from _typeshed import Self, SupportsRead, SupportsReadline
|
||||
from collections.abc import Callable, Iterable, Iterator
|
||||
from socket import socket
|
||||
from ssl import SSLContext
|
||||
from types import TracebackType
|
||||
from typing import Any, Callable, Iterable, Iterator, TextIO
|
||||
from typing import Any, TextIO
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto", "all_errors", "FTP_TLS"]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self, SupportsAllComparisons, SupportsItems
|
||||
from typing import Any, Callable, Generic, Hashable, Iterable, NamedTuple, Sequence, Sized, TypeVar, overload
|
||||
from collections.abc import Callable, Hashable, Iterable, Sequence, Sized
|
||||
from typing import Any, Generic, NamedTuple, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias, final
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import sys
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
from typing_extensions import Literal, TypeAlias
|
||||
|
||||
DEBUG_COLLECTABLE: Literal[2]
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
from _typeshed import BytesPath, StrOrBytesPath, StrPath, SupportsRichComparisonT
|
||||
from typing import Sequence, overload
|
||||
from collections.abc import Sequence
|
||||
from typing import overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import StrOrBytesPath
|
||||
from typing import AnyStr, Iterator
|
||||
from collections.abc import Iterator
|
||||
from typing import AnyStr
|
||||
|
||||
__all__ = ["escape", "glob", "iglob"]
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import SupportsItems
|
||||
from typing import Any, Generic, Iterable, TypeVar
|
||||
from collections.abc import Iterable
|
||||
from typing import Any, Generic, TypeVar
|
||||
|
||||
__all__ = ["TopologicalSorter", "CycleError"]
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, Self
|
||||
from typing import AbstractSet
|
||||
from collections.abc import Set as AbstractSet
|
||||
from typing_extensions import final
|
||||
|
||||
__all__ = (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from _heapq import *
|
||||
from _typeshed import SupportsRichComparison
|
||||
from typing import Any, Callable, Iterable, TypeVar
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Any, TypeVar
|
||||
|
||||
__all__ = ["heappush", "heappop", "heapify", "heapreplace", "merge", "nlargest", "nsmallest", "heappushpop"]
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer
|
||||
from collections.abc import Callable
|
||||
from types import ModuleType
|
||||
from typing import Any, AnyStr, Callable, overload
|
||||
from typing import Any, AnyStr, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# TODO more precise type for object of hashlib
|
||||
|
||||
@@ -4,8 +4,9 @@ import ssl
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import Self, WriteableBuffer
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||
from socket import socket
|
||||
from typing import IO, Any, BinaryIO, Callable, Iterable, Iterator, Mapping, Protocol, TypeVar, overload
|
||||
from typing import IO, Any, BinaryIO, Protocol, TypeVar, overload
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
__all__ = [
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Iterable, Iterator, Sequence
|
||||
from http.client import HTTPResponse
|
||||
from typing import ClassVar, Iterable, Iterator, Pattern, Sequence, TypeVar, overload
|
||||
from typing import ClassVar, Pattern, TypeVar, overload
|
||||
from urllib.request import Request
|
||||
|
||||
__all__ = [
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user