mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-04-15 12:07:40 +08:00
Add mypy error codes to '# type: ignore' comments (#6379)
This commit is contained in:
@@ -10,8 +10,8 @@ if sys.platform == "win32":
|
||||
def Modify(self, mode: int, record: _Record) -> None: ...
|
||||
def Close(self) -> None: ...
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore
|
||||
__init__: None # type: ignore
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
# Actual typename Summary, not exposed by the implementation
|
||||
class _Summary:
|
||||
def GetProperty(self, propid: int) -> str | bytes | None: ...
|
||||
@@ -19,8 +19,8 @@ if sys.platform == "win32":
|
||||
def SetProperty(self, propid: int, value: str | bytes) -> None: ...
|
||||
def Persist(self) -> None: ...
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore
|
||||
__init__: None # type: ignore
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
# Actual typename Database, not exposed by the implementation
|
||||
class _Database:
|
||||
def OpenView(self, sql: str) -> _View: ...
|
||||
@@ -28,8 +28,8 @@ if sys.platform == "win32":
|
||||
def GetSummaryInformation(self, updateCount: int) -> _Summary: ...
|
||||
def Close(self) -> None: ...
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore
|
||||
__init__: None # type: ignore
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
# Actual typename Record, not exposed by the implementation
|
||||
class _Record:
|
||||
def GetFieldCount(self) -> int: ...
|
||||
@@ -40,8 +40,8 @@ if sys.platform == "win32":
|
||||
def SetInteger(self, field: int, int: int) -> None: ...
|
||||
def ClearData(self) -> None: ...
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore
|
||||
__init__: None # type: ignore
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
def UuidCreate() -> str: ...
|
||||
def FCICreate(cabname: str, files: list[str]) -> None: ...
|
||||
def OpenDatabase(name: str, flags: int) -> _Database: ...
|
||||
|
||||
@@ -143,11 +143,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[str] | None = ...) -> Namespace: ...
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[str] | None, namespace: None) -> Namespace: ... # type: ignore
|
||||
def parse_args(self, args: Sequence[str] | None, namespace: None) -> Namespace: ... # type: ignore[misc]
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[str] | None, namespace: _N) -> _N: ...
|
||||
@overload
|
||||
def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore
|
||||
def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore[misc]
|
||||
@overload
|
||||
def parse_args(self, *, namespace: _N) -> _N: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# sys.
|
||||
import sys
|
||||
import typing as _typing
|
||||
from _ast import * # type: ignore
|
||||
from _ast import *
|
||||
from typing import Any, Iterator, TypeVar, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
|
||||
def get_protocol(self) -> protocols.BaseProtocol: ...
|
||||
def is_closing(self) -> bool: ...
|
||||
def close(self) -> None: ...
|
||||
def get_pid(self) -> int | None: ... # type: ignore
|
||||
def get_pid(self) -> int | None: ... # type: ignore[override]
|
||||
def get_returncode(self) -> int | None: ...
|
||||
def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore
|
||||
def get_pipe_transport(self, fd: int) -> _File: ... # type: ignore[override]
|
||||
def _check_proc(self) -> None: ... # undocumented
|
||||
def send_signal(self, signal: int) -> None: ... # type: ignore
|
||||
def send_signal(self, signal: int) -> None: ... # type: ignore[override]
|
||||
def terminate(self) -> None: ...
|
||||
def kill(self) -> None: ...
|
||||
async def _connect_pipes(self, waiter: futures.Future[Any] | None) -> None: ... # undocumented
|
||||
|
||||
@@ -34,7 +34,7 @@ else:
|
||||
) -> Iterator[Future[_T]]: ...
|
||||
|
||||
@overload
|
||||
def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = ...) -> _FT: ... # type: ignore
|
||||
def ensure_future(coro_or_future: _FT, *, loop: AbstractEventLoop | None = ...) -> _FT: ... # type: ignore[misc]
|
||||
@overload
|
||||
def ensure_future(coro_or_future: Awaitable[_T], *, loop: AbstractEventLoop | None = ...) -> Task[_T]: ...
|
||||
|
||||
@@ -232,7 +232,7 @@ if sys.version_info >= (3, 10):
|
||||
def shield(arg: _FutureT[_T]) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ...) -> Future[_T]: ...
|
||||
@overload
|
||||
def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> Future[tuple[set[_FT], set[_FT]]]: ... # type: ignore
|
||||
def wait(fs: Iterable[_FT], *, timeout: float | None = ..., return_when: str = ...) -> Future[tuple[set[_FT], set[_FT]]]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def wait(
|
||||
fs: Iterable[Awaitable[_T]], *, timeout: float | None = ..., return_when: str = ...
|
||||
@@ -243,7 +243,9 @@ else:
|
||||
def shield(arg: _FutureT[_T], *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
|
||||
def sleep(delay: float, result: _T = ..., *, loop: AbstractEventLoop | None = ...) -> Future[_T]: ...
|
||||
@overload
|
||||
def wait(fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...) -> Future[tuple[set[_FT], set[_FT]]]: ... # type: ignore
|
||||
def wait( # type: ignore[misc]
|
||||
fs: Iterable[_FT], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...
|
||||
) -> Future[tuple[set[_FT], set[_FT]]]: ...
|
||||
@overload
|
||||
def wait(
|
||||
fs: Iterable[Awaitable[_T]], *, loop: AbstractEventLoop | None = ..., timeout: float | None = ..., return_when: str = ...
|
||||
|
||||
@@ -111,7 +111,7 @@ class BZ2File(BaseStream, IO[bytes]):
|
||||
) -> None: ...
|
||||
def read(self, size: int | None = ...) -> bytes: ...
|
||||
def read1(self, size: int = ...) -> bytes: ...
|
||||
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore
|
||||
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore[override]
|
||||
def readinto(self, b: WriteableBuffer) -> int: ...
|
||||
def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
|
||||
@@ -53,11 +53,11 @@ _BytesToBytesEncodingT = Literal[
|
||||
@overload
|
||||
def encode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ...
|
||||
@overload
|
||||
def encode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ... # type: ignore
|
||||
def encode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ... # type: ignore[misc]
|
||||
@overload
|
||||
def encode(obj: str, encoding: str = ..., errors: str = ...) -> bytes: ...
|
||||
@overload
|
||||
def decode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... # type: ignore
|
||||
def decode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... # type: ignore[misc]
|
||||
@overload
|
||||
def decode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = ...) -> str: ...
|
||||
@overload
|
||||
|
||||
@@ -95,9 +95,9 @@ class UserString(Sequence[str]):
|
||||
def __contains__(self, char: object) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
# It should return a str to implement Sequence correctly, but it doesn't.
|
||||
def __getitem__(self: _UserStringT, i: int | slice) -> _UserStringT: ... # type: ignore
|
||||
def __iter__(self: _UserStringT) -> Iterator[_UserStringT]: ... # type: ignore
|
||||
def __reversed__(self: _UserStringT) -> Iterator[_UserStringT]: ... # type: ignore
|
||||
def __getitem__(self: _UserStringT, i: int | slice) -> _UserStringT: ... # type: ignore[override]
|
||||
def __iter__(self: _UserStringT) -> Iterator[_UserStringT]: ... # type: ignore[override]
|
||||
def __reversed__(self: _UserStringT) -> Iterator[_UserStringT]: ... # type: ignore[override]
|
||||
def __add__(self: _UserStringT, other: object) -> _UserStringT: ...
|
||||
def __mul__(self: _UserStringT, n: int) -> _UserStringT: ...
|
||||
def __mod__(self: _UserStringT, args: Any) -> _UserStringT: ...
|
||||
@@ -170,7 +170,7 @@ class deque(MutableSequence[_T], Generic[_T]):
|
||||
def extendleft(self, __iterable: Iterable[_T]) -> None: ...
|
||||
def insert(self, __i: int, __x: _T) -> None: ...
|
||||
def index(self, __x: _T, __start: int = ..., __stop: int = ...) -> int: ...
|
||||
def pop(self) -> _T: ... # type: ignore
|
||||
def pop(self) -> _T: ... # type: ignore[override]
|
||||
def popleft(self) -> _T: ...
|
||||
def remove(self, __value: _T) -> None: ...
|
||||
def reverse(self) -> None: ...
|
||||
@@ -212,7 +212,7 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def elements(self) -> Iterator[_T]: ...
|
||||
def most_common(self, n: int | None = ...) -> list[tuple[_T, int]]: ...
|
||||
@classmethod
|
||||
def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore
|
||||
def fromkeys(cls, iterable: Any, v: int | None = ...) -> NoReturn: ... # type: ignore[override]
|
||||
@overload
|
||||
def subtract(self, __iterable: None = ...) -> None: ...
|
||||
@overload
|
||||
@@ -233,13 +233,13 @@ class Counter(Dict[_T, int], Generic[_T]):
|
||||
def __add__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __sub__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __and__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __or__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore
|
||||
def __or__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore[override]
|
||||
def __pos__(self) -> Counter[_T]: ...
|
||||
def __neg__(self) -> Counter[_T]: ...
|
||||
def __iadd__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __isub__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __iand__(self, other: Counter[_T]) -> Counter[_T]: ...
|
||||
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore
|
||||
def __ior__(self, other: Counter[_T]) -> Counter[_T]: ... # type: ignore[override]
|
||||
|
||||
@final
|
||||
class _OrderedDictKeysView(dict_keys[_KT_co, _VT_co], Reversible[_KT_co]): # type: ignore[misc]
|
||||
|
||||
@@ -122,7 +122,7 @@ class RawConfigParser(_parser):
|
||||
fallback: _T = ...,
|
||||
) -> _T: ...
|
||||
# This is incompatible with MutableMapping so we ignore the type
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def get(self, section: str, option: str, *, raw: bool = ..., vars: _section | None = ...) -> str: ...
|
||||
@overload
|
||||
def get(self, section: str, option: str, *, raw: bool = ..., vars: _section | None = ..., fallback: _T) -> str | _T: ...
|
||||
@@ -153,7 +153,16 @@ class SectionProxy(MutableMapping[str, str]):
|
||||
def parser(self) -> RawConfigParser: ...
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
def get(self, option: str, fallback: str | None = ..., *, raw: bool = ..., vars: _section | None = ..., _impl: Any | None = ..., **kwargs: Any) -> str: ... # type: ignore
|
||||
def get( # type: ignore[override]
|
||||
self,
|
||||
option: str,
|
||||
fallback: str | None = ...,
|
||||
*,
|
||||
raw: bool = ...,
|
||||
vars: _section | None = ...,
|
||||
_impl: Any | None = ...,
|
||||
**kwargs: Any,
|
||||
) -> str: ...
|
||||
# These are partially-applied version of the methods with the same names in
|
||||
# RawConfigParser; the stubs should be kept updated together
|
||||
@overload
|
||||
|
||||
@@ -36,10 +36,10 @@ class _GeneratorContextManager(AbstractContextManager[_T_co]):
|
||||
def __call__(self, func: _F) -> _F: ...
|
||||
|
||||
# type ignore to deal with incomplete ParamSpec support in mypy
|
||||
def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, _GeneratorContextManager[_T]]: ... # type: ignore
|
||||
def contextmanager(func: Callable[_P, Iterator[_T]]) -> Callable[_P, _GeneratorContextManager[_T]]: ... # type: ignore[misc]
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T]]) -> Callable[_P, AbstractAsyncContextManager[_T]]: ... # type: ignore
|
||||
def asynccontextmanager(func: Callable[_P, AsyncIterator[_T]]) -> Callable[_P, AbstractAsyncContextManager[_T]]: ... # type: ignore[misc]
|
||||
|
||||
class _SupportsClose(Protocol):
|
||||
def close(self) -> object: ...
|
||||
|
||||
@@ -76,8 +76,8 @@ class _CDataMeta(type):
|
||||
# By default mypy complains about the following two methods, because strictly speaking cls
|
||||
# might not be a Type[_CT]. However this can never actually happen, because the only class that
|
||||
# uses _CDataMeta as its metaclass is _CData. So it's safe to ignore the errors here.
|
||||
def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
|
||||
def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore
|
||||
def __mul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore[misc]
|
||||
def __rmul__(cls: Type[_CT], other: int) -> Type[Array[_CT]]: ... # type: ignore[misc]
|
||||
|
||||
class _CData(metaclass=_CDataMeta):
|
||||
_b_base: int
|
||||
|
||||
@@ -276,10 +276,10 @@ class datetime(date):
|
||||
def utcoffset(self) -> timedelta | None: ...
|
||||
def tzname(self) -> str | None: ...
|
||||
def dst(self) -> timedelta | None: ...
|
||||
def __le__(self, __other: datetime) -> bool: ... # type: ignore
|
||||
def __lt__(self, __other: datetime) -> bool: ... # type: ignore
|
||||
def __ge__(self, __other: datetime) -> bool: ... # type: ignore
|
||||
def __gt__(self, __other: datetime) -> bool: ... # type: ignore
|
||||
def __le__(self, __other: datetime) -> bool: ... # type: ignore[override]
|
||||
def __lt__(self, __other: datetime) -> bool: ... # type: ignore[override]
|
||||
def __ge__(self, __other: datetime) -> bool: ... # type: ignore[override]
|
||||
def __gt__(self, __other: datetime) -> bool: ... # type: ignore[override]
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload # type: ignore[override]
|
||||
def __sub__(self: _D, __other: timedelta) -> _D: ...
|
||||
|
||||
@@ -31,7 +31,7 @@ class _gdbm:
|
||||
def keys(self) -> list[bytes]: ...
|
||||
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore
|
||||
__init__: None # type: ignore
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _gdbm: ...
|
||||
|
||||
@@ -29,7 +29,7 @@ class _dbm:
|
||||
def keys(self) -> list[bytes]: ...
|
||||
def setdefault(self, k: _KeyType, default: _ValueType = ...) -> bytes: ...
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore
|
||||
__init__: None # type: ignore
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _dbm: ...
|
||||
|
||||
@@ -34,9 +34,7 @@ class SequenceMatcher(Generic[_T]):
|
||||
|
||||
# mypy thinks the signatures of the overloads overlap, but the types still work fine
|
||||
@overload
|
||||
def get_close_matches( # type: ignore
|
||||
word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...
|
||||
) -> list[AnyStr]: ...
|
||||
def get_close_matches(word: AnyStr, possibilities: Iterable[AnyStr], n: int = ..., cutoff: float = ...) -> list[AnyStr]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def get_close_matches(
|
||||
word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from ..cmd import Command
|
||||
_Reporter = Any # really docutils.utils.Reporter
|
||||
|
||||
# Only defined if docutils is installed.
|
||||
class SilentReporter(_Reporter): # type: ignore
|
||||
class SilentReporter(_Reporter):
|
||||
messages: Any
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -334,7 +334,7 @@ class Terminal(str):
|
||||
def pop_trailing_ws(self) -> None: ...
|
||||
@property
|
||||
def comments(self) -> list[str]: ...
|
||||
def __getnewargs__(self) -> tuple[str, str]: ... # type: ignore
|
||||
def __getnewargs__(self) -> tuple[str, str]: ... # type: ignore[override]
|
||||
|
||||
class WhiteSpaceTerminal(Terminal):
|
||||
@property
|
||||
|
||||
@@ -30,7 +30,7 @@ class Policy:
|
||||
class Compat32(Policy):
|
||||
def header_source_parse(self, sourcelines: list[str]) -> tuple[str, str]: ...
|
||||
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> str | Header: ... # type: ignore
|
||||
def header_fetch_parse(self, name: str, value: str) -> str | Header: ... # type: ignore[override]
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class auto(IntFlag):
|
||||
def __new__(cls: Type[_T]) -> _T: ...
|
||||
|
||||
class Flag(Enum):
|
||||
name: str | None # type: ignore
|
||||
name: str | None # type: ignore[assignment]
|
||||
value: int
|
||||
def __contains__(self: _T, other: _T) -> bool: ...
|
||||
def __repr__(self) -> str: ...
|
||||
|
||||
@@ -96,7 +96,7 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
|
||||
def read(self, amt: int | None = ...) -> bytes: ...
|
||||
def read1(self, n: int = ...) -> bytes: ...
|
||||
def readinto(self, b: WriteableBuffer) -> int: ...
|
||||
def readline(self, limit: int = ...) -> bytes: ... # type: ignore
|
||||
def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override]
|
||||
@overload
|
||||
def getheader(self, name: str) -> str | None: ...
|
||||
@overload
|
||||
|
||||
@@ -29,7 +29,7 @@ class Morsel(Dict[str, Any], Generic[_T]):
|
||||
def set(self, key: str, val: str, coded_val: _T, LegalChars: str = ...) -> None: ...
|
||||
def setdefault(self, key: str, val: str | None = ...) -> str: ...
|
||||
# The dict update can also get a keywords argument so this is incompatible
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def update(self, values: Mapping[str, str]) -> None: ...
|
||||
@overload
|
||||
def update(self, values: Iterable[tuple[str, str]]) -> None: ...
|
||||
|
||||
@@ -7,9 +7,9 @@ from typing_extensions import ParamSpec
|
||||
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
def module_for_loader(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... # type: ignore
|
||||
def set_loader(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... # type: ignore
|
||||
def set_package(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... # type: ignore
|
||||
def module_for_loader(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... # type: ignore[misc]
|
||||
def set_loader(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... # type: ignore[misc]
|
||||
def set_package(fxn: Callable[_P, types.ModuleType]) -> Callable[_P, types.ModuleType]: ... # type: ignore[misc]
|
||||
def resolve_name(name: str, package: str | None) -> str: ...
|
||||
|
||||
MAGIC_NUMBER: bytes
|
||||
|
||||
@@ -331,7 +331,7 @@ class Traceback(NamedTuple):
|
||||
lineno: int
|
||||
function: str
|
||||
code_context: list[str] | None
|
||||
index: int | None # type: ignore
|
||||
index: int | None # type: ignore[assignment]
|
||||
|
||||
class FrameInfo(NamedTuple):
|
||||
frame: FrameType
|
||||
@@ -339,7 +339,7 @@ class FrameInfo(NamedTuple):
|
||||
lineno: int
|
||||
function: str
|
||||
code_context: list[str] | None
|
||||
index: int | None # type: ignore
|
||||
index: int | None # type: ignore[assignment]
|
||||
|
||||
def getframeinfo(frame: FrameType | TracebackType, context: int = ...) -> Traceback: ...
|
||||
def getouterframes(frame: Any, context: int = ...) -> list[FrameInfo]: ...
|
||||
|
||||
@@ -65,7 +65,7 @@ class BufferedIOBase(IOBase):
|
||||
|
||||
class FileIO(RawIOBase, BinaryIO):
|
||||
mode: str
|
||||
name: StrOrBytesPath | int # type: ignore
|
||||
name: StrOrBytesPath | int # type: ignore[assignment]
|
||||
def __init__(
|
||||
self, file: StrOrBytesPath | int, mode: str = ..., closefd: bool = ..., opener: _Opener | None = ...
|
||||
) -> None: ...
|
||||
@@ -87,7 +87,7 @@ class BytesIO(BufferedIOBase, BinaryIO):
|
||||
if sys.version_info >= (3, 7):
|
||||
def read1(self, __size: int | None = ...) -> bytes: ...
|
||||
else:
|
||||
def read1(self, __size: int | None) -> bytes: ... # type: ignore
|
||||
def read1(self, __size: int | None) -> bytes: ... # type: ignore[override]
|
||||
|
||||
class BufferedReader(BufferedIOBase, BinaryIO):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
@@ -96,7 +96,7 @@ class BufferedReader(BufferedIOBase, BinaryIO):
|
||||
if sys.version_info >= (3, 7):
|
||||
def read1(self, __size: int = ...) -> bytes: ...
|
||||
else:
|
||||
def read1(self, __size: int) -> bytes: ... # type: ignore
|
||||
def read1(self, __size: int) -> bytes: ... # type: ignore[override]
|
||||
|
||||
class BufferedWriter(BufferedIOBase, BinaryIO):
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
@@ -110,7 +110,7 @@ class BufferedRandom(BufferedReader, BufferedWriter):
|
||||
if sys.version_info >= (3, 7):
|
||||
def read1(self, __size: int = ...) -> bytes: ...
|
||||
else:
|
||||
def read1(self, __size: int) -> bytes: ... # type: ignore
|
||||
def read1(self, __size: int) -> bytes: ... # type: ignore[override]
|
||||
|
||||
class BufferedRWPair(BufferedIOBase):
|
||||
def __init__(self, reader: RawIOBase, writer: RawIOBase, buffer_size: int = ...) -> None: ...
|
||||
@@ -120,13 +120,13 @@ class TextIOBase(IOBase):
|
||||
encoding: str
|
||||
errors: str | None
|
||||
newlines: str | Tuple[str, ...] | None
|
||||
def __iter__(self) -> Iterator[str]: ... # type: ignore
|
||||
def __next__(self) -> str: ... # type: ignore
|
||||
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
|
||||
def __next__(self) -> str: ... # type: ignore[override]
|
||||
def detach(self) -> BinaryIO: ...
|
||||
def write(self, __s: str) -> int: ...
|
||||
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore
|
||||
def readline(self, __size: int = ...) -> str: ... # type: ignore
|
||||
def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore
|
||||
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override]
|
||||
def readline(self, __size: int = ...) -> str: ... # type: ignore[override]
|
||||
def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override]
|
||||
def read(self, __size: int | None = ...) -> str: ...
|
||||
def tell(self) -> int: ...
|
||||
|
||||
@@ -160,11 +160,11 @@ class TextIOWrapper(TextIOBase, TextIO):
|
||||
) -> None: ...
|
||||
# These are inherited from TextIOBase, but must exist in the stub to satisfy mypy.
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __iter__(self) -> Iterator[str]: ... # type: ignore
|
||||
def __next__(self) -> str: ... # type: ignore
|
||||
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore
|
||||
def readline(self, __size: int = ...) -> str: ... # type: ignore
|
||||
def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore
|
||||
def __iter__(self) -> Iterator[str]: ... # type: ignore[override]
|
||||
def __next__(self) -> str: ... # type: ignore[override]
|
||||
def writelines(self, __lines: Iterable[str]) -> None: ... # type: ignore[override]
|
||||
def readline(self, __size: int = ...) -> str: ... # type: ignore[override]
|
||||
def readlines(self, __hint: int = ...) -> list[str]: ... # type: ignore[override]
|
||||
def seek(self, __cookie: int, __whence: int = ...) -> int: ...
|
||||
|
||||
class StringIO(TextIOWrapper):
|
||||
|
||||
@@ -128,7 +128,7 @@ class SocketHandler(Handler):
|
||||
def createSocket(self) -> None: ...
|
||||
|
||||
class DatagramHandler(SocketHandler):
|
||||
def makeSocket(self) -> socket: ... # type: ignore
|
||||
def makeSocket(self) -> socket: ... # type: ignore[override]
|
||||
|
||||
class SysLogHandler(Handler):
|
||||
LOG_EMERG: int
|
||||
|
||||
@@ -103,7 +103,7 @@ def pow(__x: _SupportsFloatOrIndex, __y: _SupportsFloatOrIndex) -> float: ...
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = ...) -> int: ... # type: ignore
|
||||
def prod(__iterable: Iterable[SupportsIndex], *, start: SupportsIndex = ...) -> int: ... # type: ignore[misc]
|
||||
@overload
|
||||
def prod(__iterable: Iterable[_SupportsFloatOrIndex], *, start: _SupportsFloatOrIndex = ...) -> float: ...
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
|
||||
putenv: Callable[[AnyStr, AnyStr], None],
|
||||
unsetenv: Callable[[AnyStr, AnyStr], None],
|
||||
) -> None: ...
|
||||
def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... # type: ignore
|
||||
def setdefault(self, key: AnyStr, value: AnyStr) -> AnyStr: ... # type: ignore[override]
|
||||
def copy(self) -> dict[AnyStr, AnyStr]: ...
|
||||
def __delitem__(self, key: AnyStr) -> None: ...
|
||||
def __getitem__(self, key: AnyStr) -> AnyStr: ...
|
||||
@@ -773,7 +773,7 @@ if sys.platform != "win32":
|
||||
|
||||
class _wrap_close(_TextIOWrapper):
|
||||
def __init__(self, stream: _TextIOWrapper, proc: Popen[str]) -> None: ...
|
||||
def close(self) -> int | None: ... # type: ignore
|
||||
def close(self) -> int | None: ... # type: ignore[override]
|
||||
|
||||
def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ...
|
||||
def spawnl(mode: int, file: StrOrBytesPath, arg0: StrOrBytesPath, *args: StrOrBytesPath) -> int: ...
|
||||
|
||||
@@ -40,7 +40,7 @@ class SMTPChannel(asynchat.async_chat):
|
||||
decode_data: bool = ...,
|
||||
) -> None: ...
|
||||
# base asynchat.async_chat.push() accepts bytes
|
||||
def push(self, msg: str) -> None: ... # type: ignore
|
||||
def push(self, msg: str) -> None: ... # type: ignore[override]
|
||||
def collect_incoming_data(self, data: bytes) -> None: ...
|
||||
def found_terminator(self) -> None: ...
|
||||
def smtp_HELO(self, arg: str) -> None: ...
|
||||
@@ -77,11 +77,7 @@ class SMTPServer(asyncore.dispatcher):
|
||||
class DebuggingServer(SMTPServer): ...
|
||||
|
||||
class PureProxy(SMTPServer):
|
||||
def process_message( # type: ignore
|
||||
self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str
|
||||
) -> str | None: ...
|
||||
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override]
|
||||
|
||||
class MailmanProxy(PureProxy):
|
||||
def process_message( # type: ignore
|
||||
self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str
|
||||
) -> str | None: ...
|
||||
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[str], data: bytes | str) -> str | None: ... # type: ignore[override]
|
||||
|
||||
@@ -570,9 +570,9 @@ class socket(_socket.socket):
|
||||
) -> BinaryIO: ...
|
||||
def sendfile(self, file: BinaryIO, offset: int = ..., count: int | None = ...) -> int: ...
|
||||
@property
|
||||
def family(self) -> AddressFamily: ... # type: ignore
|
||||
def family(self) -> AddressFamily: ... # type: ignore[override]
|
||||
@property
|
||||
def type(self) -> SocketKind: ... # type: ignore
|
||||
def type(self) -> SocketKind: ... # type: ignore[override]
|
||||
def get_inheritable(self) -> bool: ...
|
||||
def set_inheritable(self, inheritable: bool) -> None: ...
|
||||
|
||||
@@ -593,7 +593,7 @@ if sys.platform == "win32":
|
||||
def socketpair(family: int = ..., type: int = ..., proto: int = ...) -> tuple[socket, socket]: ...
|
||||
|
||||
else:
|
||||
def socketpair( # type: ignore
|
||||
def socketpair(
|
||||
family: int | AddressFamily | None = ..., type: SocketType | int = ..., proto: int = ...
|
||||
) -> tuple[socket, socket]: ...
|
||||
|
||||
|
||||
@@ -1136,7 +1136,7 @@ class Canvas(Widget, XView, YView):
|
||||
# Canvas.bbox() args are `str | _CanvasItemId`, but mypy rejects that
|
||||
# description because it's incompatible with Misc.bbox(), an alias for
|
||||
# Misc.grid_bbox(). Yes it is, but there's not much we can do about it.
|
||||
def bbox(self, *args: str | _CanvasItemId) -> tuple[int, int, int, int]: ... # type: ignore
|
||||
def bbox(self, *args: str | _CanvasItemId) -> tuple[int, int, int, int]: ... # type: ignore[override]
|
||||
@overload
|
||||
def tag_bind(
|
||||
self,
|
||||
@@ -1506,10 +1506,10 @@ class Canvas(Widget, XView, YView):
|
||||
#
|
||||
# But mypy doesn't like aliasing here (maybe because Misc defines the same names)
|
||||
def tag_lower(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ...
|
||||
def lower(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore
|
||||
def lower(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore[override]
|
||||
def tag_raise(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ...
|
||||
def tkraise(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore
|
||||
def lift(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore
|
||||
def tkraise(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore[override]
|
||||
def lift(self, __first: str | _CanvasItemId, __second: str | _CanvasItemId | None = ...) -> None: ... # type: ignore[override]
|
||||
def scale(self, *args): ...
|
||||
def scan_mark(self, x, y): ...
|
||||
def scan_dragto(self, x, y, gain: int = ...): ...
|
||||
@@ -1738,7 +1738,7 @@ class Entry(Widget, XView):
|
||||
def scan_mark(self, x): ...
|
||||
def scan_dragto(self, x): ...
|
||||
def selection_adjust(self, index: _EntryIndex) -> None: ...
|
||||
def selection_clear(self) -> None: ... # type: ignore
|
||||
def selection_clear(self) -> None: ... # type: ignore[override]
|
||||
def selection_from(self, index: _EntryIndex) -> None: ...
|
||||
def selection_present(self) -> bool: ...
|
||||
def selection_range(self, start: _EntryIndex, end: _EntryIndex) -> None: ...
|
||||
@@ -1984,7 +1984,7 @@ class Listbox(Widget, XView, YView):
|
||||
def see(self, index): ...
|
||||
def selection_anchor(self, index): ...
|
||||
select_anchor: Any
|
||||
def selection_clear(self, first, last: Any | None = ...): ... # type: ignore
|
||||
def selection_clear(self, first, last: Any | None = ...): ... # type: ignore[override]
|
||||
select_clear: Any
|
||||
def selection_includes(self, index): ...
|
||||
select_includes: Any
|
||||
@@ -2794,7 +2794,7 @@ class Text(Widget, XView, YView):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure
|
||||
def bbox(self, index: _TextIndex) -> tuple[int, int, int, int] | None: ... # type: ignore
|
||||
def bbox(self, index: _TextIndex) -> tuple[int, int, int, int] | None: ... # type: ignore[override]
|
||||
def compare(self, index1: _TextIndex, op: Literal["<", "<=", "==", ">=", ">", "!="], index2: _TextIndex) -> bool: ...
|
||||
def count(self, index1, index2, *args): ... # TODO
|
||||
@overload
|
||||
|
||||
@@ -266,7 +266,7 @@ class PanedWindow(TixWidget):
|
||||
def __init__(self, master: tkinter.Widget | None, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
|
||||
def add(self, name: str, cnf: dict[str, Any] = ..., **kw: Any) -> None: ...
|
||||
def delete(self, name: str) -> None: ...
|
||||
def forget(self, name: str) -> None: ... # type: ignore
|
||||
def forget(self, name: str) -> None: ... # type: ignore[override]
|
||||
def panecget(self, entry: str, opt: Any) -> Any: ...
|
||||
def paneconfigure(self, entry: str, cnf: dict[str, Any] = ..., **kw: Any) -> Any | None: ...
|
||||
def panes(self) -> list[tkinter.Widget]: ...
|
||||
|
||||
@@ -158,7 +158,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
width: int = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ...,
|
||||
) -> None: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -183,7 +183,7 @@ class Entry(Widget, tkinter.Entry):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
# config must be copy/pasted, otherwise ttk.Entry().config is mypy error (don't know why)
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -238,7 +238,7 @@ class Combobox(Entry):
|
||||
width: int = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ..., # undocumented
|
||||
) -> None: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -266,7 +266,7 @@ class Combobox(Entry):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
# config must be copy/pasted, otherwise ttk.Combobox().config is mypy error (don't know why)
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -547,7 +547,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
width: int = ...,
|
||||
) -> None: ...
|
||||
def add(self, child: tkinter.Widget, *, weight: int = ..., **kw) -> None: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -561,7 +561,7 @@ class Panedwindow(Widget, tkinter.PanedWindow):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
# config must be copy/pasted, otherwise ttk.Panedwindow().config is mypy error (don't know why)
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -688,7 +688,7 @@ class Scale(Widget, tkinter.Scale):
|
||||
value: float = ...,
|
||||
variable: tkinter.IntVar | tkinter.DoubleVar = ...,
|
||||
) -> None: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -708,7 +708,7 @@ class Scale(Widget, tkinter.Scale):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
# config must be copy/pasted, otherwise ttk.Scale().config is mypy error (don't know why)
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -742,7 +742,7 @@ class Scrollbar(Widget, tkinter.Scrollbar):
|
||||
style: str = ...,
|
||||
takefocus: tkinter._TakeFocusValue = ...,
|
||||
) -> None: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -756,7 +756,7 @@ class Scrollbar(Widget, tkinter.Scrollbar):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
# config must be copy/pasted, otherwise ttk.Scrollbar().config is mypy error (don't know why)
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def config(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -852,7 +852,7 @@ if sys.version_info >= (3, 7):
|
||||
wrap: bool = ...,
|
||||
xscrollcommand: tkinter._XYScrollCommand = ...,
|
||||
) -> None: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def configure(
|
||||
self,
|
||||
cnf: dict[str, Any] | None = ...,
|
||||
@@ -883,7 +883,7 @@ if sys.version_info >= (3, 7):
|
||||
) -> dict[str, tuple[str, str, str, Any, Any]] | None: ...
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure # type: ignore
|
||||
config = configure # type: ignore[assignment]
|
||||
def set(self, value: Any) -> None: ...
|
||||
|
||||
class _TreeviewItemDict(TypedDict):
|
||||
@@ -959,7 +959,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
@overload
|
||||
def configure(self, cnf: str) -> tuple[str, str, str, Any, Any]: ...
|
||||
config = configure
|
||||
def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore
|
||||
def bbox(self, item, column: _TreeviewColumnId | None = ...) -> tuple[int, int, int, int] | Literal[""]: ... # type: ignore[override]
|
||||
def get_children(self, item: str | None = ...) -> Tuple[str, ...]: ...
|
||||
def set_children(self, item: str, *newchildren: str) -> None: ...
|
||||
@overload
|
||||
@@ -987,7 +987,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView):
|
||||
def delete(self, *items: str) -> None: ...
|
||||
def detach(self, *items: str) -> None: ...
|
||||
def exists(self, item: str) -> bool: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def focus(self, item: None = ...) -> str: ... # can return empty string
|
||||
@overload
|
||||
def focus(self, item: str) -> Literal[""]: ...
|
||||
|
||||
@@ -178,7 +178,7 @@ class TPen(object):
|
||||
def isvisible(self) -> bool: ...
|
||||
# Note: signatures 1 and 2 overlap unsafely when no arguments are provided
|
||||
@overload
|
||||
def pen(self) -> _PenState: ... # type: ignore
|
||||
def pen(self) -> _PenState: ... # type: ignore[misc]
|
||||
@overload
|
||||
def pen(
|
||||
self,
|
||||
@@ -220,7 +220,7 @@ class RawTurtle(TPen, TNavigator):
|
||||
def shape(self, name: str) -> None: ...
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapesize(self) -> tuple[float, float, float]: ... # type: ignore
|
||||
def shapesize(self) -> tuple[float, float, float]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def shapesize(
|
||||
self, stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ...
|
||||
@@ -231,7 +231,7 @@ class RawTurtle(TPen, TNavigator):
|
||||
def shearfactor(self, shear: float) -> None: ...
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore
|
||||
def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def shapetransform(
|
||||
self, t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ...
|
||||
@@ -449,7 +449,7 @@ def isvisible() -> bool: ...
|
||||
|
||||
# Note: signatures 1 and 2 overlap unsafely when no arguments are provided
|
||||
@overload
|
||||
def pen() -> _PenState: ... # type: ignore
|
||||
def pen() -> _PenState: ... # type: ignore[misc]
|
||||
@overload
|
||||
def pen(
|
||||
pen: _PenState | None = ...,
|
||||
@@ -485,7 +485,7 @@ def shape(name: str) -> None: ...
|
||||
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapesize() -> tuple[float, float, float]: ... # type: ignore
|
||||
def shapesize() -> tuple[float, float, float]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def shapesize(stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ...) -> None: ...
|
||||
@overload
|
||||
@@ -495,7 +495,7 @@ def shearfactor(shear: float) -> None: ...
|
||||
|
||||
# Unsafely overlaps when no arguments are provided
|
||||
@overload
|
||||
def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore
|
||||
def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def shapetransform(
|
||||
t11: float | None = ..., t12: float | None = ..., t21: float | None = ..., t22: float | None = ...
|
||||
|
||||
@@ -36,7 +36,7 @@ _V_co = TypeVar("_V_co", covariant=True)
|
||||
|
||||
@final
|
||||
class _Cell:
|
||||
__hash__: None # type: ignore
|
||||
__hash__: None # type: ignore[assignment]
|
||||
cell_contents: Any
|
||||
|
||||
@final
|
||||
@@ -149,7 +149,7 @@ class CodeType:
|
||||
|
||||
@final
|
||||
class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]):
|
||||
__hash__: None # type: ignore
|
||||
__hash__: None # type: ignore[assignment]
|
||||
def __init__(self, mapping: Mapping[_KT, _VT_co]) -> None: ...
|
||||
def __getitem__(self, k: _KT) -> _VT_co: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
@@ -165,7 +165,7 @@ class MappingProxyType(Mapping[_KT, _VT_co], Generic[_KT, _VT_co]):
|
||||
def __ror__(self, __value: Mapping[_T1, _T2]) -> dict[_KT | _T1, _VT_co | _T2]: ...
|
||||
|
||||
class SimpleNamespace:
|
||||
__hash__: None # type: ignore
|
||||
__hash__: None # type: ignore[assignment]
|
||||
def __init__(self, **kwargs: Any) -> None: ...
|
||||
def __getattribute__(self, name: str) -> Any: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
@@ -382,9 +382,9 @@ _P = ParamSpec("_P")
|
||||
|
||||
# it's not really an Awaitable, but can be used in an await expression. Real type: Generator & Awaitable
|
||||
@overload
|
||||
def coroutine(func: Callable[_P, Generator[_R, Any, Any]]) -> Callable[_P, Awaitable[_R]]: ... # type: ignore
|
||||
def coroutine(func: Callable[_P, Generator[_R, Any, Any]]) -> Callable[_P, Awaitable[_R]]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def coroutine(func: _Fn) -> _Fn: ... # type: ignore
|
||||
def coroutine(func: _Fn) -> _Fn: ... # type: ignore[misc]
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
CellType = _Cell
|
||||
|
||||
@@ -96,7 +96,7 @@ _T_contra = TypeVar("_T_contra", contravariant=True) # Ditto contravariant.
|
||||
_TC = TypeVar("_TC", bound=Type[object])
|
||||
|
||||
def no_type_check(arg: _F) -> _F: ...
|
||||
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore
|
||||
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore[misc]
|
||||
|
||||
# Type aliases and type constructors
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class TestCase:
|
||||
def assertLess(self, a: Any, b: Any, msg: Any = ...) -> None: ...
|
||||
def assertLessEqual(self, a: Any, b: Any, msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def assertRaises( # type: ignore
|
||||
def assertRaises( # type: ignore[misc]
|
||||
self,
|
||||
expected_exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
callable: Callable[..., Any],
|
||||
@@ -91,7 +91,7 @@ class TestCase:
|
||||
@overload
|
||||
def assertRaises(self, expected_exception: Type[_E] | Tuple[Type[_E], ...], msg: Any = ...) -> _AssertRaisesContext[_E]: ...
|
||||
@overload
|
||||
def assertRaisesRegex( # type: ignore
|
||||
def assertRaisesRegex( # type: ignore[misc]
|
||||
self,
|
||||
expected_exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
@@ -107,13 +107,13 @@ class TestCase:
|
||||
msg: Any = ...,
|
||||
) -> _AssertRaisesContext[_E]: ...
|
||||
@overload
|
||||
def assertWarns( # type: ignore
|
||||
def assertWarns( # type: ignore[misc]
|
||||
self, expected_warning: Type[Warning] | Tuple[Type[Warning], ...], callable: Callable[..., Any], *args: Any, **kwargs: Any
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertWarns(self, expected_warning: Type[Warning] | Tuple[Type[Warning], ...], msg: Any = ...) -> _AssertWarnsContext: ...
|
||||
@overload
|
||||
def assertWarnsRegex( # type: ignore
|
||||
def assertWarnsRegex( # type: ignore[misc]
|
||||
self,
|
||||
expected_warning: Type[Warning] | Tuple[Type[Warning], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
@@ -195,7 +195,7 @@ class TestCase:
|
||||
def assert_(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
def failIf(self, expr: bool, msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def failUnlessRaises( # type: ignore
|
||||
def failUnlessRaises( # type: ignore[misc]
|
||||
self,
|
||||
exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
callable: Callable[..., Any] = ...,
|
||||
@@ -215,7 +215,7 @@ class TestCase:
|
||||
def assertRegexpMatches(self, text: AnyStr, regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
def assertNotRegexpMatches(self, text: AnyStr, regex: AnyStr | Pattern[AnyStr], msg: Any = ...) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp( # type: ignore
|
||||
def assertRaisesRegexp( # type: ignore[misc]
|
||||
self,
|
||||
exception: Type[BaseException] | Tuple[Type[BaseException], ...],
|
||||
expected_regex: str | bytes | Pattern[str] | Pattern[bytes],
|
||||
|
||||
@@ -71,7 +71,7 @@ class _MockIter:
|
||||
class Base:
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class NonCallableMock(Base, Any): # type: ignore
|
||||
class NonCallableMock(Base, Any):
|
||||
def __new__(__cls, *args: Any, **kw: Any) -> NonCallableMock: ...
|
||||
def __init__(
|
||||
self,
|
||||
@@ -210,7 +210,7 @@ class _patcher:
|
||||
# Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock],
|
||||
# but that's impossible with the current type system.
|
||||
@overload
|
||||
def __call__( # type: ignore
|
||||
def __call__( # type: ignore[misc]
|
||||
self,
|
||||
target: Any,
|
||||
new: _T,
|
||||
@@ -222,7 +222,7 @@ class _patcher:
|
||||
**kwargs: Any,
|
||||
) -> _patch[_T]: ...
|
||||
@overload
|
||||
def __call__( # type: ignore
|
||||
def __call__(
|
||||
self,
|
||||
target: Any,
|
||||
*,
|
||||
@@ -235,7 +235,7 @@ class _patcher:
|
||||
) -> _patch[MagicMock | AsyncMock]: ...
|
||||
else:
|
||||
@overload
|
||||
def __call__( # type: ignore
|
||||
def __call__( # type: ignore[misc]
|
||||
self,
|
||||
target: Any,
|
||||
new: _T,
|
||||
@@ -247,7 +247,7 @@ class _patcher:
|
||||
**kwargs: Any,
|
||||
) -> _patch[_T]: ...
|
||||
@overload
|
||||
def __call__( # type: ignore
|
||||
def __call__(
|
||||
self,
|
||||
target: Any,
|
||||
*,
|
||||
@@ -260,7 +260,7 @@ class _patcher:
|
||||
) -> _patch[MagicMock]: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload
|
||||
def object( # type: ignore
|
||||
def object( # type: ignore[misc]
|
||||
self,
|
||||
target: Any,
|
||||
attribute: str,
|
||||
@@ -273,7 +273,7 @@ class _patcher:
|
||||
**kwargs: Any,
|
||||
) -> _patch[_T]: ...
|
||||
@overload
|
||||
def object( # type: ignore
|
||||
def object(
|
||||
self,
|
||||
target: Any,
|
||||
attribute: str,
|
||||
@@ -287,7 +287,7 @@ class _patcher:
|
||||
) -> _patch[MagicMock | AsyncMock]: ...
|
||||
else:
|
||||
@overload
|
||||
def object( # type: ignore
|
||||
def object( # type: ignore[misc]
|
||||
self,
|
||||
target: Any,
|
||||
attribute: str,
|
||||
@@ -300,7 +300,7 @@ class _patcher:
|
||||
**kwargs: Any,
|
||||
) -> _patch[_T]: ...
|
||||
@overload
|
||||
def object( # type: ignore
|
||||
def object(
|
||||
self,
|
||||
target: Any,
|
||||
attribute: str,
|
||||
|
||||
@@ -11,4 +11,4 @@ def removeResult(result: unittest.result.TestResult) -> bool: ...
|
||||
@overload
|
||||
def removeHandler(method: None = ...) -> None: ...
|
||||
@overload
|
||||
def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore
|
||||
def removeHandler(method: Callable[_P, _T]) -> Callable[_P, _T]: ... # type: ignore[misc]
|
||||
|
||||
@@ -37,9 +37,9 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
def __str__(self) -> str: ...
|
||||
def copy(self) -> WeakValueDictionary[_KT, _VT]: ...
|
||||
# These are incompatible with Mapping
|
||||
def keys(self) -> Iterator[_KT]: ... # type: ignore
|
||||
def values(self) -> Iterator[_VT]: ... # type: ignore
|
||||
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore
|
||||
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]
|
||||
def values(self) -> Iterator[_VT]: ... # type: ignore[override]
|
||||
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override]
|
||||
def itervaluerefs(self) -> Iterator[KeyedRef[_KT, _VT]]: ...
|
||||
def valuerefs(self) -> list[KeyedRef[_KT, _VT]]: ...
|
||||
def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ...
|
||||
@@ -68,9 +68,9 @@ class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
def __str__(self) -> str: ...
|
||||
def copy(self) -> WeakKeyDictionary[_KT, _VT]: ...
|
||||
# These are incompatible with Mapping
|
||||
def keys(self) -> Iterator[_KT]: ... # type: ignore
|
||||
def values(self) -> Iterator[_VT]: ... # type: ignore
|
||||
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore
|
||||
def keys(self) -> Iterator[_KT]: ... # type: ignore[override]
|
||||
def values(self) -> Iterator[_VT]: ... # type: ignore[override]
|
||||
def items(self) -> Iterator[tuple[_KT, _VT]]: ... # type: ignore[override]
|
||||
def keyrefs(self) -> list[ref[_KT]]: ...
|
||||
def setdefault(self, key: _KT, default: _VT = ...) -> _VT: ...
|
||||
@overload
|
||||
|
||||
@@ -11,7 +11,7 @@ class NodeList(List[_T]):
|
||||
class EmptyNodeList(Tuple[Any, ...]):
|
||||
length: int
|
||||
def item(self, index: int) -> None: ...
|
||||
def __add__(self, other: Iterable[_T]) -> NodeList[_T]: ... # type: ignore
|
||||
def __add__(self, other: Iterable[_T]) -> NodeList[_T]: ... # type: ignore[override]
|
||||
def __radd__(self, other: Iterable[_T]) -> NodeList[_T]: ...
|
||||
|
||||
def defproperty(klass: Type[Any], name: str, doc: str) -> None: ...
|
||||
|
||||
@@ -2,5 +2,5 @@ from typing import Any
|
||||
|
||||
def __getattr__(name: str) -> Any: ... # incomplete
|
||||
|
||||
class DocumentLS(Any): ... # type: ignore
|
||||
class DOMImplementationLS(Any): ... # type: ignore
|
||||
class DocumentLS(Any): ...
|
||||
class DOMImplementationLS(Any): ...
|
||||
|
||||
@@ -68,7 +68,7 @@ class DateTime:
|
||||
def __le__(self, other: _DateTimeComparable) -> bool: ...
|
||||
def __gt__(self, other: _DateTimeComparable) -> bool: ...
|
||||
def __ge__(self, other: _DateTimeComparable) -> bool: ...
|
||||
def __eq__(self, other: _DateTimeComparable) -> bool: ... # type: ignore
|
||||
def __eq__(self, other: _DateTimeComparable) -> bool: ... # type: ignore[override]
|
||||
def make_comparable(self, other: _DateTimeComparable) -> tuple[str, str]: ... # undocumented
|
||||
def timetuple(self) -> time.struct_time: ... # undocumented
|
||||
def decode(self, data: Any) -> None: ...
|
||||
|
||||
@@ -120,7 +120,16 @@ class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
|
||||
def handle_request(self, request_text: str | None = ...) -> None: ...
|
||||
|
||||
class ServerHTMLDoc(pydoc.HTMLDoc): # undocumented
|
||||
def docroutine(self, object: object, name: str, mod: str | None = ..., funcs: Mapping[str, str] = ..., classes: Mapping[str, str] = ..., methods: Mapping[str, str] = ..., cl: type | None = ...) -> str: ... # type: ignore
|
||||
def docroutine( # type: ignore[override]
|
||||
self,
|
||||
object: object,
|
||||
name: str,
|
||||
mod: str | None = ...,
|
||||
funcs: Mapping[str, str] = ...,
|
||||
classes: Mapping[str, str] = ...,
|
||||
methods: Mapping[str, str] = ...,
|
||||
cl: type | None = ...,
|
||||
) -> str: ...
|
||||
def docserver(self, server_name: str, package_documentation: str, methods: dict[str, str]) -> str: ...
|
||||
|
||||
class XMLRPCDocGenerator: # undocumented
|
||||
|
||||
@@ -97,10 +97,10 @@ class ZipExtFile(io.BufferedIOBase):
|
||||
close_fileobj: Literal[False] = ...,
|
||||
) -> None: ...
|
||||
def read(self, n: int | None = ...) -> bytes: ...
|
||||
def readline(self, limit: int = ...) -> bytes: ... # type: ignore
|
||||
def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override]
|
||||
def __repr__(self) -> str: ...
|
||||
def peek(self, n: int = ...) -> bytes: ...
|
||||
def read1(self, n: int | None) -> bytes: ... # type: ignore
|
||||
def read1(self, n: int | None) -> bytes: ... # type: ignore[override]
|
||||
if sys.version_info >= (3, 7):
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user