mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Add mypy error codes to type: ignores, remove unused ignores (#7504)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
@@ -337,7 +337,7 @@ class unicode(basestring, Sequence[unicode]):
|
||||
def __ge__(self, x: unicode) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
# The argument type is incompatible with Sequence
|
||||
def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore
|
||||
def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore[override]
|
||||
def __iter__(self) -> Iterator[unicode]: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
@@ -415,7 +415,7 @@ class str(Sequence[str], basestring):
|
||||
def zfill(self, __width: int) -> str: ...
|
||||
def __add__(self, s: AnyStr) -> AnyStr: ...
|
||||
# Incompatible with Sequence.__contains__
|
||||
def __contains__(self, o: str | Text) -> bool: ... # type: ignore
|
||||
def __contains__(self, o: str | Text) -> bool: ... # type: ignore[override]
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ge__(self, x: Text) -> bool: ...
|
||||
def __getitem__(self, i: int | slice) -> str: ...
|
||||
@@ -491,7 +491,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
@overload
|
||||
@@ -507,7 +507,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def __add__(self, s: bytes) -> bytearray: ...
|
||||
def __mul__(self, n: int) -> bytearray: ...
|
||||
# Incompatible with Sequence.__contains__
|
||||
def __contains__(self, o: int | bytes) -> bool: ... # type: ignore
|
||||
def __contains__(self, o: int | bytes) -> bool: ... # type: ignore[override]
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: bytes) -> bool: ...
|
||||
@@ -575,7 +575,7 @@ class slice(object):
|
||||
def __init__(self, stop: Any) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def indices(self, len: int) -> tuple[int, int, int]: ...
|
||||
|
||||
class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
@@ -622,7 +622,7 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
@@ -684,7 +684,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
def __delitem__(self, v: _KT) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
class set(MutableSet[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
|
||||
@@ -726,7 +726,7 @@ class set(MutableSet[_T], Generic[_T]):
|
||||
def __lt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
class frozenset(AbstractSet[_T_co], Generic[_T_co]):
|
||||
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
|
||||
@@ -785,10 +785,10 @@ class property(object):
|
||||
|
||||
long = int
|
||||
|
||||
class _NotImplementedType(Any): # type: ignore
|
||||
class _NotImplementedType(Any): # type: ignore[misc]
|
||||
# A little weird, but typing the __call__ as NotImplemented makes the error message
|
||||
# for NotImplemented() much better
|
||||
__call__: NotImplemented # type: ignore
|
||||
__call__: NotImplemented # type: ignore[valid-type]
|
||||
|
||||
NotImplemented: _NotImplementedType
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -107,11 +107,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[Text] | None = ...) -> Namespace: ...
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[Text] | None, namespace: None) -> Namespace: ... # type: ignore
|
||||
def parse_args(self, args: Sequence[Text] | None, namespace: None) -> Namespace: ... # type: ignore[misc]
|
||||
@overload
|
||||
def parse_args(self, args: Sequence[Text] | 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: ...
|
||||
def add_subparsers(
|
||||
|
||||
@@ -28,7 +28,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
def fromfile(self, __f: BinaryIO, __n: int) -> None: ...
|
||||
def fromlist(self, __list: list[_T]) -> None: ...
|
||||
def fromunicode(self, __ustr: str) -> None: ...
|
||||
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
|
||||
def index(self, __v: _T) -> int: ... # Overrides Sequence
|
||||
def insert(self, __i: int, __v: _T) -> None: ...
|
||||
def pop(self, __i: int = ...) -> _T: ...
|
||||
def read(self, f: BinaryIO, n: int) -> None: ...
|
||||
@@ -45,7 +45,7 @@ class array(MutableSequence[_T], Generic[_T]):
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> array[_T]: ...
|
||||
@overload # type: ignore # Overrides MutableSequence
|
||||
@overload # type: ignore[override]
|
||||
def __setitem__(self, i: int, o: _T) -> None: ...
|
||||
@overload
|
||||
def __setitem__(self, s: slice, o: array[_T]) -> None: ...
|
||||
|
||||
@@ -337,7 +337,7 @@ class unicode(basestring, Sequence[unicode]):
|
||||
def __ge__(self, x: unicode) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
# The argument type is incompatible with Sequence
|
||||
def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore
|
||||
def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore[override]
|
||||
def __iter__(self) -> Iterator[unicode]: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
@@ -415,7 +415,7 @@ class str(Sequence[str], basestring):
|
||||
def zfill(self, __width: int) -> str: ...
|
||||
def __add__(self, s: AnyStr) -> AnyStr: ...
|
||||
# Incompatible with Sequence.__contains__
|
||||
def __contains__(self, o: str | Text) -> bool: ... # type: ignore
|
||||
def __contains__(self, o: str | Text) -> bool: ... # type: ignore[override]
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ge__(self, x: Text) -> bool: ...
|
||||
def __getitem__(self, i: int | slice) -> str: ...
|
||||
@@ -491,7 +491,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> int: ...
|
||||
@overload
|
||||
@@ -507,7 +507,7 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
def __add__(self, s: bytes) -> bytearray: ...
|
||||
def __mul__(self, n: int) -> bytearray: ...
|
||||
# Incompatible with Sequence.__contains__
|
||||
def __contains__(self, o: int | bytes) -> bool: ... # type: ignore
|
||||
def __contains__(self, o: int | bytes) -> bool: ... # type: ignore[override]
|
||||
def __eq__(self, x: object) -> bool: ...
|
||||
def __ne__(self, x: object) -> bool: ...
|
||||
def __lt__(self, x: bytes) -> bool: ...
|
||||
@@ -575,7 +575,7 @@ class slice(object):
|
||||
def __init__(self, stop: Any) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
def indices(self, len: int) -> tuple[int, int, int]: ...
|
||||
|
||||
class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
@@ -622,7 +622,7 @@ class list(MutableSequence[_T], Generic[_T]):
|
||||
def sort(self, cmp: Callable[[_T, _T], Any] = ..., key: Callable[[_T], Any] = ..., reverse: bool = ...) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[_T]: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> _T: ...
|
||||
@overload
|
||||
@@ -684,7 +684,7 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
|
||||
def __setitem__(self, k: _KT, v: _VT) -> None: ...
|
||||
def __delitem__(self, v: _KT) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
class set(MutableSet[_T], Generic[_T]):
|
||||
def __init__(self, iterable: Iterable[_T] = ...) -> None: ...
|
||||
@@ -726,7 +726,7 @@ class set(MutableSet[_T], Generic[_T]):
|
||||
def __lt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __ge__(self, s: AbstractSet[object]) -> bool: ...
|
||||
def __gt__(self, s: AbstractSet[object]) -> bool: ...
|
||||
__hash__: ClassVar[None] # type: ignore
|
||||
__hash__: ClassVar[None] # type: ignore[assignment]
|
||||
|
||||
class frozenset(AbstractSet[_T_co], Generic[_T_co]):
|
||||
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...
|
||||
@@ -785,10 +785,10 @@ class property(object):
|
||||
|
||||
long = int
|
||||
|
||||
class _NotImplementedType(Any): # type: ignore
|
||||
class _NotImplementedType(Any): # type: ignore[misc]
|
||||
# A little weird, but typing the __call__ as NotImplemented makes the error message
|
||||
# for NotImplemented() much better
|
||||
__call__: NotImplemented # type: ignore
|
||||
__call__: NotImplemented # type: ignore[valid-type]
|
||||
|
||||
NotImplemented: _NotImplementedType
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class BZ2File(io.BufferedIOBase, IO[bytes]):
|
||||
def __init__(self, filename: _PathOrFile, mode: str = ..., buffering: Any | None = ..., compresslevel: int = ...) -> 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: ...
|
||||
|
||||
@@ -55,11 +55,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: ...
|
||||
@overload
|
||||
def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ...
|
||||
@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 = ...) -> Text: ...
|
||||
@overload
|
||||
@@ -243,7 +243,7 @@ class StreamRecoder(BinaryIO):
|
||||
def next(self) -> bytes: ...
|
||||
def __iter__(self: Self) -> Self: ...
|
||||
def write(self, data: bytes) -> int: ...
|
||||
def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore # it's supposed to return None
|
||||
def writelines(self, list: Iterable[bytes]) -> int: ... # type: ignore[override] # it's supposed to return None
|
||||
def reset(self) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
|
||||
@@ -67,8 +67,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 = ...
|
||||
|
||||
@@ -214,13 +214,13 @@ 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]
|
||||
def __add__(self, other: timedelta) -> datetime: ...
|
||||
def __radd__(self, other: timedelta) -> datetime: ...
|
||||
@overload # type: ignore
|
||||
@overload # type: ignore[override]
|
||||
def __sub__(self, other: datetime) -> timedelta: ...
|
||||
@overload
|
||||
def __sub__(self, other: timedelta) -> datetime: ...
|
||||
|
||||
@@ -30,7 +30,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: ...
|
||||
|
||||
@@ -29,9 +29,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 = ...
|
||||
|
||||
@@ -6,9 +6,9 @@ from typing_extensions import Literal
|
||||
# Iterable[T], so that Union[List[T], Literal[""]] could be used as a return
|
||||
# type. But because this only works when T is str, we need Sequence[T] instead.
|
||||
@overload
|
||||
def commonprefix(m: Sequence[str]) -> str | Literal[""]: ... # type: ignore
|
||||
def commonprefix(m: Sequence[str]) -> str | Literal[""]: ... # type: ignore[misc]
|
||||
@overload
|
||||
def commonprefix(m: Sequence[Text]) -> Text: ... # type: ignore
|
||||
def commonprefix(m: Sequence[Text]) -> Text: ...
|
||||
@overload
|
||||
def commonprefix(m: Sequence[list[SupportsLessThanT]]) -> Sequence[SupportsLessThanT]: ...
|
||||
@overload
|
||||
|
||||
@@ -104,7 +104,7 @@ class Traceback(NamedTuple):
|
||||
lineno: int
|
||||
function: str
|
||||
code_context: list[str] | None
|
||||
index: int | None # type: ignore
|
||||
index: int | None # type: ignore[assignment]
|
||||
|
||||
_FrameInfo = tuple[FrameType, str, int, str, Optional[list[str]], Optional[int]]
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class SocketHandler(Handler):
|
||||
def createSocket(self) -> None: ...
|
||||
|
||||
class DatagramHandler(SocketHandler):
|
||||
def makeSocket(self) -> SocketType: ... # type: ignore
|
||||
def makeSocket(self) -> SocketType: ... # type: ignore[override]
|
||||
|
||||
class SysLogHandler(Handler):
|
||||
LOG_EMERG: int
|
||||
|
||||
@@ -9,8 +9,7 @@ class SMTPChannel(asynchat.async_chat):
|
||||
COMMAND: int
|
||||
DATA: int
|
||||
def __init__(self, server: SMTPServer, conn: socket.socket, addr: Any, data_size_limit: int = ...) -> None: ...
|
||||
# base asynchat.async_chat.push() accepts bytes
|
||||
def push(self, msg: Text) -> None: ... # type: ignore
|
||||
def push(self, msg: Text) -> None: ...
|
||||
def collect_incoming_data(self, data: bytes) -> None: ...
|
||||
def found_terminator(self) -> None: ...
|
||||
def smtp_HELO(self, arg: str) -> None: ...
|
||||
@@ -35,11 +34,7 @@ class SMTPServer(asyncore.dispatcher):
|
||||
class DebuggingServer(SMTPServer): ...
|
||||
|
||||
class PureProxy(SMTPServer):
|
||||
def process_message( # type: ignore
|
||||
self, peer: _Address, mailfrom: str, rcpttos: list[Text], data: bytes | str
|
||||
) -> str | None: ...
|
||||
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[Text], data: bytes | str) -> str | None: ... # type: ignore[override]
|
||||
|
||||
class MailmanProxy(PureProxy):
|
||||
def process_message( # type: ignore
|
||||
self, peer: _Address, mailfrom: str, rcpttos: list[Text], data: bytes | str
|
||||
) -> str | None: ...
|
||||
def process_message(self, peer: _Address, mailfrom: str, rcpttos: list[Text], data: bytes | str) -> str | None: ... # type: ignore[override]
|
||||
|
||||
@@ -175,7 +175,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,
|
||||
@@ -215,7 +215,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 = ...
|
||||
@@ -423,7 +423,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 = ...,
|
||||
@@ -459,7 +459,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: ...
|
||||
def settiltangle(angle: float) -> None: ...
|
||||
|
||||
@@ -47,8 +47,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
|
||||
# Using NoReturn so that only calls using mypy plugin hook that specialize the signature
|
||||
# can go through.
|
||||
def setdefault(self, k: NoReturn, default: object) -> object: ...
|
||||
# Mypy plugin hook for 'pop' expects that 'default' has a type variable type.
|
||||
def pop(self, k: NoReturn, default: _T = ...) -> object: ... # type: ignore
|
||||
def pop(self, k: NoReturn, default: _T = ...) -> object: ...
|
||||
def update(self: _T, __m: _T) -> None: ...
|
||||
def has_key(self, k: str) -> bool: ...
|
||||
def viewitems(self) -> ItemsView[str, object]: ...
|
||||
|
||||
@@ -43,7 +43,7 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]):
|
||||
class KeyedRef(ref[_T], Generic[_KT, _T]):
|
||||
key: _KT
|
||||
# This __new__ method uses a non-standard name for the "cls" parameter
|
||||
def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> KeyedRef[_KT, _T]: ... # type: ignore
|
||||
def __new__(type, ob: _T, callback: Callable[[_T], Any], key: _KT) -> KeyedRef[_KT, _T]: ...
|
||||
def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ...
|
||||
|
||||
class WeakKeyDictionary(MutableMapping[_KT, _VT]):
|
||||
|
||||
@@ -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): ...
|
||||
|
||||
@@ -58,8 +58,8 @@ class DateTime:
|
||||
def __le__(self, other: _dateTimeComp) -> bool: ...
|
||||
def __gt__(self, other: _dateTimeComp) -> bool: ...
|
||||
def __ge__(self, other: _dateTimeComp) -> bool: ...
|
||||
def __eq__(self, other: _dateTimeComp) -> bool: ... # type: ignore
|
||||
def __ne__(self, other: _dateTimeComp) -> bool: ... # type: ignore
|
||||
def __eq__(self, other: _dateTimeComp) -> bool: ... # type: ignore[override]
|
||||
def __ne__(self, other: _dateTimeComp) -> bool: ... # type: ignore[override]
|
||||
def timetuple(self) -> struct_time: ...
|
||||
def __cmp__(self, other: _dateTimeComp) -> int: ...
|
||||
def decode(self, data: Any) -> None: ...
|
||||
|
||||
@@ -30,9 +30,9 @@ class ZipExtFile(io.BufferedIOBase):
|
||||
close_fileobj: bool = ...,
|
||||
) -> 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 peek(self, n: int = ...) -> bytes: ...
|
||||
def read1(self, n: int | None) -> bytes: ... # type: ignore
|
||||
def read1(self, n: int | None) -> bytes: ...
|
||||
|
||||
class _Writer(Protocol):
|
||||
def write(self, __s: str) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user