From eea6d8d79c1680226643b28bd2da56a61e2e54ab Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 16 Mar 2022 20:12:44 +0000 Subject: [PATCH 1/8] Remove all `type: ignore`s without error codes --- stdlib/@python2/__builtin__.pyi | 28 +++++++++---------- stdlib/@python2/_msi.pyi | 16 +++++------ stdlib/@python2/argparse.pyi | 4 +-- stdlib/@python2/array.pyi | 4 +-- stdlib/@python2/builtins.pyi | 28 +++++++++---------- stdlib/@python2/bz2.pyi | 2 +- stdlib/@python2/codecs.pyi | 6 ++-- stdlib/@python2/ctypes/__init__.pyi | 4 +-- stdlib/@python2/datetime.pyi | 10 +++---- stdlib/@python2/dbm/gnu.pyi | 4 +-- stdlib/@python2/dbm/ndbm.pyi | 4 +-- stdlib/@python2/difflib.pyi | 4 +-- stdlib/@python2/genericpath.pyi | 4 +-- stdlib/@python2/inspect.pyi | 2 +- stdlib/@python2/logging/handlers.pyi | 2 +- stdlib/@python2/smtpd.pyi | 10 ++----- stdlib/@python2/turtle.pyi | 8 +++--- stdlib/@python2/typing_extensions.pyi | 2 +- stdlib/@python2/weakref.pyi | 2 +- stdlib/@python2/xml/dom/minicompat.pyi | 2 +- stdlib/@python2/xml/dom/xmlbuilder.pyi | 4 +-- stdlib/@python2/xmlrpclib.pyi | 4 +-- stdlib/@python2/zipfile.pyi | 4 +-- stdlib/builtins.pyi | 2 +- stdlib/enum.pyi | 6 ++-- stdlib/http/client.pyi | 2 +- stdlib/importlib/machinery.pyi | 4 +-- stdlib/importlib/metadata/__init__.pyi | 2 +- stdlib/io.pyi | 10 +++---- stdlib/typing.pyi | 2 +- stdlib/typing_extensions.pyi | 2 +- stdlib/unittest/mock.pyi | 2 +- stdlib/weakref.pyi | 2 +- stubs/Flask-Cors/flask_cors/core.pyi | 4 +-- .../sqlalchemy/dialects/mysql/enumerated.pyi | 2 +- .../sqlalchemy/dialects/mysql/types.pyi | 2 +- .../sqlalchemy/dialects/postgresql/base.pyi | 2 +- .../sqlalchemy/dialects/sybase/pyodbc.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/context.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi | 2 +- stubs/babel/babel/support.pyi | 2 +- stubs/beautifulsoup4/bs4/__init__.pyi | 4 ++- .../beautifulsoup4/bs4/builder/_html5lib.pyi | 6 ++-- stubs/beautifulsoup4/bs4/builder/_lxml.pyi | 4 +-- stubs/beautifulsoup4/bs4/element.pyi | 4 +-- stubs/boto/boto/auth.pyi | 2 +- stubs/boto/boto/connection.pyi | 4 ++- stubs/boto/boto/s3/connection.pyi | 15 +++++++++- stubs/filelock/filelock/__init__.pyi | 2 +- stubs/mock/mock/mock.pyi | 2 +- stubs/mypy-extensions/mypy_extensions.pyi | 2 +- stubs/openpyxl/openpyxl/chart/bar_chart.pyi | 2 +- .../openpyxl/openpyxl/chart/surface_chart.pyi | 2 +- .../parsimonious/parsimonious/expressions.pyi | 4 +-- stubs/parsimonious/parsimonious/grammar.pyi | 2 +- stubs/passlib/passlib/handlers/argon2.pyi | 6 ++-- stubs/passlib/passlib/handlers/bcrypt.pyi | 4 +-- stubs/passlib/passlib/handlers/cisco.pyi | 2 +- stubs/passlib/passlib/handlers/des_crypt.pyi | 8 +++--- stubs/passlib/passlib/handlers/django.pyi | 8 +++--- stubs/passlib/passlib/handlers/fshp.pyi | 2 +- .../passlib/passlib/handlers/ldap_digests.pyi | 2 +- stubs/passlib/passlib/handlers/md5_crypt.pyi | 4 +-- stubs/passlib/passlib/handlers/misc.pyi | 4 +-- stubs/passlib/passlib/handlers/mssql.pyi | 4 +-- stubs/passlib/passlib/handlers/oracle.pyi | 4 +-- stubs/passlib/passlib/handlers/pbkdf2.pyi | 10 +++---- stubs/passlib/passlib/handlers/phpass.pyi | 2 +- stubs/passlib/passlib/handlers/postgres.pyi | 2 +- stubs/passlib/passlib/handlers/scram.pyi | 2 +- stubs/passlib/passlib/handlers/scrypt.pyi | 2 +- stubs/passlib/passlib/handlers/sha1_crypt.pyi | 2 +- stubs/passlib/passlib/handlers/sha2_crypt.pyi | 2 +- .../passlib/handlers/sun_md5_crypt.pyi | 2 +- stubs/passlib/passlib/handlers/windows.pyi | 6 ++-- stubs/passlib/passlib/totp.pyi | 2 +- stubs/passlib/passlib/utils/handlers.pyi | 2 +- stubs/polib/polib.pyi | 4 +-- 79 files changed, 182 insertions(+), 171 deletions(-) diff --git a/stdlib/@python2/__builtin__.pyi b/stdlib/@python2/__builtin__.pyi index b6ac2b78aca8..c2477d5f4501 100644 --- a/stdlib/@python2/__builtin__.pyi +++ b/stdlib/@python2/__builtin__.pyi @@ -336,7 +336,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: ... def __iter__(self) -> Iterator[unicode]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... @@ -414,7 +414,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: ... def __eq__(self, x: object) -> bool: ... def __ge__(self, x: Text) -> bool: ... def __getitem__(self, i: int | slice) -> str: ... @@ -490,7 +490,7 @@ class bytearray(MutableSequence[int], ByteString): def __iter__(self) -> Iterator[int]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... - __hash__: None # type: ignore + __hash__: None @overload def __getitem__(self, i: int) -> int: ... @overload @@ -506,7 +506,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: ... def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... def __lt__(self, x: bytes) -> bool: ... @@ -574,7 +574,7 @@ class slice(object): def __init__(self, stop: Any) -> None: ... @overload def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... - __hash__: None # type: ignore + __hash__: None def indices(self, len: int) -> tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): @@ -621,7 +621,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__: None # type: ignore + __hash__: None @overload def __getitem__(self, i: int) -> _T: ... @overload @@ -683,7 +683,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__: None # type: ignore + __hash__: None class set(MutableSet[_T], Generic[_T]): def __init__(self, iterable: Iterable[_T] = ...) -> None: ... @@ -715,7 +715,7 @@ class set(MutableSet[_T], Generic[_T]): def __sub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __sub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... - @overload # type: ignore + @overload def __isub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __isub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... @@ -725,7 +725,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__: None # type: ignore + __hash__: None class frozenset(AbstractSet[_T_co], Generic[_T_co]): def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... @@ -784,10 +784,10 @@ class property(object): long = int -class _NotImplementedType(Any): # type: ignore +class _NotImplementedType(Any): # A little weird, but typing the __call__ as NotImplemented makes the error message # for NotImplemented() much better - __call__: NotImplemented # type: ignore + __call__: NotImplemented NotImplemented: _NotImplementedType @@ -816,11 +816,11 @@ def eval( def execfile(__filename: str, __globals: dict[str, Any] | None = ..., __locals: dict[str, Any] | None = ...) -> None: ... def exit(code: object = ...) -> NoReturn: ... @overload -def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore +def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... @overload -def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... # type: ignore +def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... @overload -def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... # type: ignore +def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... @overload def filter(__function: None, __iterable: Iterable[_T | None]) -> list[_T]: ... @overload diff --git a/stdlib/@python2/_msi.pyi b/stdlib/@python2/_msi.pyi index 754febe68da9..84bd2fd915bb 100644 --- a/stdlib/@python2/_msi.pyi +++ b/stdlib/@python2/_msi.pyi @@ -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 + __init__: None # 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 + __init__: None # 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 + __init__: None # 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 + __init__: None def UuidCreate() -> str: ... def FCICreate(cabname: str, files: list[str]) -> None: ... def OpenDatabase(name: str, flags: int) -> _Database: ... diff --git a/stdlib/@python2/argparse.pyi b/stdlib/@python2/argparse.pyi index 3eacc7b1dc3b..698c662db9c9 100644 --- a/stdlib/@python2/argparse.pyi +++ b/stdlib/@python2/argparse.pyi @@ -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: ... @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: ... @overload def parse_args(self, *, namespace: _N) -> _N: ... def add_subparsers( diff --git a/stdlib/@python2/array.pyi b/stdlib/@python2/array.pyi index fcd1d7bfa4d0..1ff2e3f96f0e 100644 --- a/stdlib/@python2/array.pyi +++ b/stdlib/@python2/array.pyi @@ -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 # Overrides MutableSequence def __setitem__(self, i: int, o: _T) -> None: ... @overload def __setitem__(self, s: slice, o: array[_T]) -> None: ... diff --git a/stdlib/@python2/builtins.pyi b/stdlib/@python2/builtins.pyi index b6ac2b78aca8..c2477d5f4501 100644 --- a/stdlib/@python2/builtins.pyi +++ b/stdlib/@python2/builtins.pyi @@ -336,7 +336,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: ... def __iter__(self) -> Iterator[unicode]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... @@ -414,7 +414,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: ... def __eq__(self, x: object) -> bool: ... def __ge__(self, x: Text) -> bool: ... def __getitem__(self, i: int | slice) -> str: ... @@ -490,7 +490,7 @@ class bytearray(MutableSequence[int], ByteString): def __iter__(self) -> Iterator[int]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... - __hash__: None # type: ignore + __hash__: None @overload def __getitem__(self, i: int) -> int: ... @overload @@ -506,7 +506,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: ... def __eq__(self, x: object) -> bool: ... def __ne__(self, x: object) -> bool: ... def __lt__(self, x: bytes) -> bool: ... @@ -574,7 +574,7 @@ class slice(object): def __init__(self, stop: Any) -> None: ... @overload def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... - __hash__: None # type: ignore + __hash__: None def indices(self, len: int) -> tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): @@ -621,7 +621,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__: None # type: ignore + __hash__: None @overload def __getitem__(self, i: int) -> _T: ... @overload @@ -683,7 +683,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__: None # type: ignore + __hash__: None class set(MutableSet[_T], Generic[_T]): def __init__(self, iterable: Iterable[_T] = ...) -> None: ... @@ -715,7 +715,7 @@ class set(MutableSet[_T], Generic[_T]): def __sub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __sub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... - @overload # type: ignore + @overload def __isub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __isub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... @@ -725,7 +725,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__: None # type: ignore + __hash__: None class frozenset(AbstractSet[_T_co], Generic[_T_co]): def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... @@ -784,10 +784,10 @@ class property(object): long = int -class _NotImplementedType(Any): # type: ignore +class _NotImplementedType(Any): # A little weird, but typing the __call__ as NotImplemented makes the error message # for NotImplemented() much better - __call__: NotImplemented # type: ignore + __call__: NotImplemented NotImplemented: _NotImplementedType @@ -816,11 +816,11 @@ def eval( def execfile(__filename: str, __globals: dict[str, Any] | None = ..., __locals: dict[str, Any] | None = ...) -> None: ... def exit(code: object = ...) -> NoReturn: ... @overload -def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore +def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... @overload -def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... # type: ignore +def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... @overload -def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... # type: ignore +def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... @overload def filter(__function: None, __iterable: Iterable[_T | None]) -> list[_T]: ... @overload diff --git a/stdlib/@python2/bz2.pyi b/stdlib/@python2/bz2.pyi index e182aa428e06..cbb5ebecf5e5 100644 --- a/stdlib/@python2/bz2.pyi +++ b/stdlib/@python2/bz2.pyi @@ -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: ... def readinto(self, b: WriteableBuffer) -> int: ... def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ... def seek(self, offset: int, whence: int = ...) -> int: ... diff --git a/stdlib/@python2/codecs.pyi b/stdlib/@python2/codecs.pyi index 0f97a4401556..6d3c49197886 100644 --- a/stdlib/@python2/codecs.pyi +++ b/stdlib/@python2/codecs.pyi @@ -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: ... @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: ... # it's supposed to return None def reset(self) -> None: ... def __getattr__(self, name: str) -> Any: ... def __enter__(self: Self) -> Self: ... diff --git a/stdlib/@python2/ctypes/__init__.pyi b/stdlib/@python2/ctypes/__init__.pyi index ef627f10f656..4493ecca323a 100644 --- a/stdlib/@python2/ctypes/__init__.pyi +++ b/stdlib/@python2/ctypes/__init__.pyi @@ -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]]: ... + def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... class _CData(metaclass=_CDataMeta): _b_base: int = ... diff --git a/stdlib/@python2/datetime.pyi b/stdlib/@python2/datetime.pyi index bdd32a8e7ef7..1ca4cd436bef 100644 --- a/stdlib/@python2/datetime.pyi +++ b/stdlib/@python2/datetime.pyi @@ -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: ... + def __lt__(self, other: datetime) -> bool: ... + def __ge__(self, other: datetime) -> bool: ... + def __gt__(self, other: datetime) -> bool: ... def __add__(self, other: timedelta) -> datetime: ... def __radd__(self, other: timedelta) -> datetime: ... - @overload # type: ignore + @overload def __sub__(self, other: datetime) -> timedelta: ... @overload def __sub__(self, other: timedelta) -> datetime: ... diff --git a/stdlib/@python2/dbm/gnu.pyi b/stdlib/@python2/dbm/gnu.pyi index 019711f62ed1..321219994d94 100644 --- a/stdlib/@python2/dbm/gnu.pyi +++ b/stdlib/@python2/dbm/gnu.pyi @@ -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 + __init__: None def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _gdbm: ... diff --git a/stdlib/@python2/dbm/ndbm.pyi b/stdlib/@python2/dbm/ndbm.pyi index 92ec92ebd0cd..12ecf4b397f2 100644 --- a/stdlib/@python2/dbm/ndbm.pyi +++ b/stdlib/@python2/dbm/ndbm.pyi @@ -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 + __init__: None def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _dbm: ... diff --git a/stdlib/@python2/difflib.pyi b/stdlib/@python2/difflib.pyi index 30b624b8fd15..32cfc9c42aeb 100644 --- a/stdlib/@python2/difflib.pyi +++ b/stdlib/@python2/difflib.pyi @@ -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]: ... @overload def get_close_matches( word: Sequence[_T], possibilities: Iterable[Sequence[_T]], n: int = ..., cutoff: float = ... diff --git a/stdlib/@python2/genericpath.pyi b/stdlib/@python2/genericpath.pyi index 66b9d5fc34a5..ca0073d75c2f 100644 --- a/stdlib/@python2/genericpath.pyi +++ b/stdlib/@python2/genericpath.pyi @@ -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[""]: ... @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 diff --git a/stdlib/@python2/inspect.pyi b/stdlib/@python2/inspect.pyi index aa0450ce6785..9cd3b6606e8e 100644 --- a/stdlib/@python2/inspect.pyi +++ b/stdlib/@python2/inspect.pyi @@ -104,7 +104,7 @@ class Traceback(NamedTuple): lineno: int function: str code_context: list[str] | None - index: int | None # type: ignore + index: int | None _FrameInfo = tuple[FrameType, str, int, str, Optional[list[str]], Optional[int]] diff --git a/stdlib/@python2/logging/handlers.pyi b/stdlib/@python2/logging/handlers.pyi index 360e76c66558..2b69096f6d82 100644 --- a/stdlib/@python2/logging/handlers.pyi +++ b/stdlib/@python2/logging/handlers.pyi @@ -52,7 +52,7 @@ class SocketHandler(Handler): def createSocket(self) -> None: ... class DatagramHandler(SocketHandler): - def makeSocket(self) -> SocketType: ... # type: ignore + def makeSocket(self) -> SocketType: ... class SysLogHandler(Handler): LOG_EMERG: int diff --git a/stdlib/@python2/smtpd.pyi b/stdlib/@python2/smtpd.pyi index 6778611a56d9..791621979144 100644 --- a/stdlib/@python2/smtpd.pyi +++ b/stdlib/@python2/smtpd.pyi @@ -10,7 +10,7 @@ class SMTPChannel(asynchat.async_chat): 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 +35,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: ... 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: ... diff --git a/stdlib/@python2/turtle.pyi b/stdlib/@python2/turtle.pyi index 7b104bec7812..ecc34282b61a 100644 --- a/stdlib/@python2/turtle.pyi +++ b/stdlib/@python2/turtle.pyi @@ -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: ... @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]: ... @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: ... @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]: ... @overload def shapesize(stretch_wid: float | None = ..., stretch_len: float | None = ..., outline: float | None = ...) -> None: ... def settiltangle(angle: float) -> None: ... diff --git a/stdlib/@python2/typing_extensions.pyi b/stdlib/@python2/typing_extensions.pyi index 53957910576c..502cd709dc78 100644 --- a/stdlib/@python2/typing_extensions.pyi +++ b/stdlib/@python2/typing_extensions.pyi @@ -48,7 +48,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): # 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]: ... diff --git a/stdlib/@python2/weakref.pyi b/stdlib/@python2/weakref.pyi index 8c65ab21a568..959c3e1b9d1e 100644 --- a/stdlib/@python2/weakref.pyi +++ b/stdlib/@python2/weakref.pyi @@ -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]): diff --git a/stdlib/@python2/xml/dom/minicompat.pyi b/stdlib/@python2/xml/dom/minicompat.pyi index 254f8a0c1657..02c2c532d9dd 100644 --- a/stdlib/@python2/xml/dom/minicompat.pyi +++ b/stdlib/@python2/xml/dom/minicompat.pyi @@ -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]: ... def __radd__(self, other: Iterable[_T]) -> NodeList[_T]: ... def defproperty(klass: type[Any], name: str, doc: str) -> None: ... diff --git a/stdlib/@python2/xml/dom/xmlbuilder.pyi b/stdlib/@python2/xml/dom/xmlbuilder.pyi index d8936bdc2ab4..a77c99790fda 100644 --- a/stdlib/@python2/xml/dom/xmlbuilder.pyi +++ b/stdlib/@python2/xml/dom/xmlbuilder.pyi @@ -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): ... diff --git a/stdlib/@python2/xmlrpclib.pyi b/stdlib/@python2/xmlrpclib.pyi index 8d2766e6578a..80fc8e086a11 100644 --- a/stdlib/@python2/xmlrpclib.pyi +++ b/stdlib/@python2/xmlrpclib.pyi @@ -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: ... + def __ne__(self, other: _dateTimeComp) -> bool: ... def timetuple(self) -> struct_time: ... def __cmp__(self, other: _dateTimeComp) -> int: ... def decode(self, data: Any) -> None: ... diff --git a/stdlib/@python2/zipfile.pyi b/stdlib/@python2/zipfile.pyi index 777692598ab7..ebcaf23c118e 100644 --- a/stdlib/@python2/zipfile.pyi +++ b/stdlib/@python2/zipfile.pyi @@ -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: ... 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: ... diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index c668ca40e976..fc4adb5307ef 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -88,7 +88,7 @@ class object: def __class__(self: Self) -> type[Self]: ... # Ignore errors about type mismatch between property getter and setter @__class__.setter - def __class__(self, __type: type[object]) -> None: ... # type: ignore # noqa: F811 + def __class__(self, __type: type[object]) -> None: ... # noqa: F811 def __init__(self) -> None: ... def __new__(cls: type[Self]) -> Self: ... # N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers. diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index a7075e030429..e88f1f1d45e5 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -66,7 +66,7 @@ class _EnumDict(dict[str, Any]): class EnumMeta(ABCMeta): if sys.version_info >= (3, 11): def __new__( - metacls: type[Self], # type: ignore + metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, @@ -76,9 +76,9 @@ class EnumMeta(ABCMeta): **kwds: Any, ) -> Self: ... elif sys.version_info >= (3, 9): - def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... # type: ignore + def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... else: - def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... # type: ignore + def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... if sys.version_info >= (3, 9): @classmethod diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index 64452dc70807..afb1ad16c835 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -100,7 +100,7 @@ class HTTPMessage(email.message.Message): def parse_headers(fp: io.BufferedIOBase, _class: Callable[[], email.message.Message] = ...) -> HTTPMessage: ... -class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore # argument disparities between base classes +class HTTPResponse(io.BufferedIOBase, BinaryIO): # argument disparities between base classes msg: HTTPMessage headers: HTTPMessage version: int diff --git a/stdlib/importlib/machinery.pyi b/stdlib/importlib/machinery.pyi index 7efe287f7205..c0f423bc62f9 100644 --- a/stdlib/importlib/machinery.pyi +++ b/stdlib/importlib/machinery.pyi @@ -133,10 +133,10 @@ class FileFinder(importlib.abc.PathEntryFinder): cls, *loader_details: tuple[type[importlib.abc.Loader], list[str]] ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... -class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): # type: ignore # argument disparities +class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): # argument disparities def set_data(self, path: importlib.abc._Path, data: bytes, *, _mode: int = ...) -> None: ... -class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... # type: ignore # argument disparities +class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... # argument disparities class ExtensionFileLoader(importlib.abc.ExecutionLoader): def __init__(self, name: str, path: importlib.abc._Path) -> None: ... diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index 52c5547a6128..a4fef9534ce8 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -182,7 +182,7 @@ class MetadataPathFinder(DistributionFinder): def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... if sys.version_info >= (3, 10): # Yes, this is an instance method that has argumend named "cls" - def invalidate_caches(cls) -> None: ... # type: ignore + def invalidate_caches(cls) -> None: ... class PathDistribution(Distribution): def __init__(self, path: Path) -> None: ... diff --git a/stdlib/io.pyi b/stdlib/io.pyi index f12d6861d517..09b20282a5e6 100644 --- a/stdlib/io.pyi +++ b/stdlib/io.pyi @@ -108,7 +108,7 @@ class BufferedIOBase(IOBase): def read(self, __size: int | None = ...) -> bytes: ... def read1(self, __size: int = ...) -> bytes: ... -class FileIO(RawIOBase, BinaryIO): # type: ignore # argument disparities between the base classes +class FileIO(RawIOBase, BinaryIO): # argument disparities between the base classes mode: str name: StrOrBytesPath | int # type: ignore[assignment] def __init__( @@ -120,7 +120,7 @@ class FileIO(RawIOBase, BinaryIO): # type: ignore # argument disparities betwee def read(self, __size: int = ...) -> bytes: ... def __enter__(self: Self) -> Self: ... -class BytesIO(BufferedIOBase, BinaryIO): # type: ignore # argument disparities between the base classes +class BytesIO(BufferedIOBase, BinaryIO): # argument disparities between the base classes def __init__(self, initial_bytes: bytes = ...) -> None: ... # BytesIO does not contain a "name" field. This workaround is necessary # to allow BytesIO sub-classes to add this field, as it is defined @@ -134,7 +134,7 @@ class BytesIO(BufferedIOBase, BinaryIO): # type: ignore # argument disparities else: def read1(self, __size: int | None) -> bytes: ... # type: ignore[override] -class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore # argument disparities between base classes +class BufferedReader(BufferedIOBase, BinaryIO): # argument disparities between base classes def __enter__(self: Self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def peek(self, __size: int = ...) -> bytes: ... @@ -143,7 +143,7 @@ class BufferedReader(BufferedIOBase, BinaryIO): # type: ignore # argument dispa else: def read1(self, __size: int) -> bytes: ... # type: ignore[override] -class BufferedWriter(BufferedIOBase, BinaryIO): # type: ignore # argument disparities between base classes +class BufferedWriter(BufferedIOBase, BinaryIO): # argument disparities between base classes def __enter__(self: Self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def write(self, __buffer: ReadableBuffer) -> int: ... @@ -175,7 +175,7 @@ class TextIOBase(IOBase): def read(self, __size: int | None = ...) -> str: ... def tell(self) -> int: ... -class TextIOWrapper(TextIOBase, TextIO): # type: ignore # argument disparities between base classes +class TextIOWrapper(TextIOBase, TextIO): # argument disparities between base classes def __init__( self, buffer: IO[bytes], diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 457ad21b72d2..469561c9dfc1 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -1207,7 +1207,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta): # 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 __delitem__(self, k: NoReturn) -> None: ... def items(self) -> ItemsView[str, object]: ... diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 193fa4feb4f3..2300c15f7b8d 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -70,7 +70,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): # 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 items(self) -> ItemsView[str, object]: ... def keys(self) -> KeysView[str]: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 4f520528cd2e..0dfc7c7d7674 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -432,7 +432,7 @@ if sys.version_info >= (3, 8): class AsyncMagicMixin(MagicMixin): def __init__(self, *args: Any, **kw: Any) -> None: ... - class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # type: ignore # argument disparities between base classes + class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # argument disparities between base classes class MagicProxy: name: str diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 820488529143..2a2e6da2ccec 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -87,7 +87,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: type[Self], ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... # type: ignore + def __new__(type: type[Self], ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... class WeakKeyDictionary(MutableMapping[_KT, _VT]): diff --git a/stubs/Flask-Cors/flask_cors/core.pyi b/stubs/Flask-Cors/flask_cors/core.pyi index b5d3c05691f3..2140105cfd46 100644 --- a/stubs/Flask-Cors/flask_cors/core.pyi +++ b/stubs/Flask-Cors/flask_cors/core.pyi @@ -53,9 +53,9 @@ def get_app_kwarg_dict(appInstance: _App | None = ...) -> _Options: ... def flexible_str(obj: object) -> str | None: ... def serialize_option(options_dict: _Options, key: str, upper: bool = ...) -> None: ... @overload -def ensure_iterable(inst: str) -> list[str]: ... # type: ignore +def ensure_iterable(inst: str) -> list[str]: ... @overload -def ensure_iterable(inst: _IterableT) -> _IterableT: ... # type: ignore +def ensure_iterable(inst: _IterableT) -> _IterableT: ... @overload def ensure_iterable(inst: _T) -> list[_T]: ... def sanitize_regex_param(param: str | list[str]) -> list[str]: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi index e68dcdfdf032..f0ea3f5d8497 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi @@ -3,7 +3,7 @@ from typing import Any from ...sql import sqltypes from .types import _StringType -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): # type: ignore # incompatible with base class +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): # incompatible with base class __visit_name__: str native_enum: bool def __init__(self, *enums, **kw) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index fecd364f683c..11ea52bcb9e1 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -32,7 +32,7 @@ class _StringType(sqltypes.String): **kw, ) -> None: ... -class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore # incompatible with base class +class _MatchType(sqltypes.Float, sqltypes.MatchType): # incompatible with base class def __init__(self, **kw) -> None: ... class NUMERIC(_NumericType, sqltypes.NUMERIC): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index a2b167315ae9..a7ef9507d162 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -96,7 +96,7 @@ PGUuid = UUID class TSVECTOR(sqltypes.TypeEngine): __visit_name__: str -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore # base classes incompatible +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # base classes incompatible native_enum: bool create_type: Any def __init__(self, *enums, **kw) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi index 2c870d14cafd..28e31f3bf525 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi @@ -10,7 +10,7 @@ class _SybNumeric_pyodbc(sqltypes.Numeric): class SybaseExecutionContext_pyodbc(SybaseExecutionContext): def set_ddl_autocommit(self, connection, value) -> None: ... -class SybaseDialect_pyodbc(PyODBCConnector, SybaseDialect): # type: ignore # argument disparities between base classes +class SybaseDialect_pyodbc(PyODBCConnector, SybaseDialect): # argument disparities between base classes supports_statement_cache: bool colspecs: Any @classmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index b5fc3cd00396..2298b688dea9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -75,7 +75,7 @@ class ORMFromStatementCompileState(ORMCompileState): @classmethod def create_for_statement(cls, statement_container, compiler, **kw): ... -class ORMSelectCompileState(ORMCompileState, SelectState): # type: ignore # argument disparities between base classes +class ORMSelectCompileState(ORMCompileState, SelectState): # argument disparities between base classes multi_row_eager_loaders: bool compound_eager_adapter: Any correlate: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index b7c82d82a7df..9cdd4f56a0ea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -37,7 +37,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause): def tometadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... def to_metadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... -class Column(DialectKWArgs, SchemaItem, ColumnClause): # type: ignore # argument disparities between base classes +class Column(DialectKWArgs, SchemaItem, ColumnClause): # argument disparities between base classes __visit_name__: str inherit_cache: bool key: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index 5075c49b91d9..471d845d6aea 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -155,7 +155,7 @@ class SchemaType(SchemaEventTarget): def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... -class Enum(Emulated, String, SchemaType): # type: ignore # argument disparities between base classes +class Enum(Emulated, String, SchemaType): # argument disparities between base classes __visit_name__: str def __init__(self, *enums, **kw) -> None: ... @property diff --git a/stubs/babel/babel/support.pyi b/stubs/babel/babel/support.pyi index 09ccd93abaa9..0ff221823e11 100644 --- a/stubs/babel/babel/support.pyi +++ b/stubs/babel/babel/support.pyi @@ -79,7 +79,7 @@ class NullTranslations(gettext.NullTranslations): ugettext: Any ungettext: Any -class Translations(NullTranslations, gettext.GNUTranslations): # type: ignore # argument disparities between base classes +class Translations(NullTranslations, gettext.GNUTranslations): # argument disparities between base classes DEFAULT_DOMAIN: str domain: Any def __init__(self, fp: Any | None = ..., domain: Any | None = ...) -> None: ... diff --git a/stubs/beautifulsoup4/bs4/__init__.pyi b/stubs/beautifulsoup4/bs4/__init__.pyi index 1b66e650fa30..9f6639df3c7e 100644 --- a/stubs/beautifulsoup4/bs4/__init__.pyi +++ b/stubs/beautifulsoup4/bs4/__init__.pyi @@ -74,7 +74,9 @@ class BeautifulSoup(Tag): def handle_starttag(self, name, namespace, nsprefix, attrs, sourceline: Any | None = ..., sourcepos: Any | None = ...): ... def handle_endtag(self, name, nsprefix: Any | None = ...) -> None: ... def handle_data(self, data) -> None: ... - def decode(self, pretty_print: bool = ..., eventual_encoding: str = ..., formatter: str | Formatter = ...): ... # type: ignore # missing some arguments + def decode( + self, pretty_print: bool = ..., eventual_encoding: str = ..., formatter: str | Formatter = ... + ): ... # missing some arguments class BeautifulStoneSoup(BeautifulSoup): ... class StopParsing(Exception): ... diff --git a/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi b/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi index 990d45060521..cfc51983b855 100644 --- a/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi +++ b/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi @@ -7,7 +7,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder): features: Any TRACKS_LINE_NUMBERS: bool user_specified_encoding: Any - def prepare_markup( # type: ignore # user_specified_encoding doesn't have a default + def prepare_markup( # user_specified_encoding doesn't have a default self, markup, user_specified_encoding, document_declared_encoding: Any | None = ..., exclude_encodings: Any | None = ... ) -> None: ... def feed(self, markup) -> None: ... @@ -15,7 +15,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder): def create_treebuilder(self, namespaceHTMLElements): ... def test_fragment_to_document(self, fragment): ... -class TreeBuilderForHtml5lib(Any): # type: ignore # html5lib.treebuilders.base.TreeBuilder +class TreeBuilderForHtml5lib(Any): # html5lib.treebuilders.base.TreeBuilder soup: Any parser: Any store_line_numbers: Any @@ -42,7 +42,7 @@ class AttrList: def __getitem__(self, name): ... def __contains__(self, name): ... -class Element(Any): # type: ignore # html5lib.treebuilders.base.Node +class Element(Any): # html5lib.treebuilders.base.Node element: Any soup: Any namespace: Any diff --git a/stubs/beautifulsoup4/bs4/builder/_lxml.pyi b/stubs/beautifulsoup4/bs4/builder/_lxml.pyi index 9133e6a17615..db631456d045 100644 --- a/stubs/beautifulsoup4/bs4/builder/_lxml.pyi +++ b/stubs/beautifulsoup4/bs4/builder/_lxml.pyi @@ -19,7 +19,7 @@ class LXMLTreeBuilderForXML(TreeBuilder): soup: Any nsmaps: Any def __init__(self, parser: Any | None = ..., empty_element_tags: Any | None = ..., **kwargs) -> None: ... - def prepare_markup( # type: ignore # the order of the parameters is different + def prepare_markup( # the order of the parameters is different self, markup, user_specified_encoding: Any | None = ..., @@ -37,7 +37,7 @@ class LXMLTreeBuilderForXML(TreeBuilder): def comment(self, content) -> None: ... def test_fragment_to_document(self, fragment): ... -class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML): # type: ignore # argument disparities between base classes +class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML): # argument disparities between base classes NAME: Any ALTERNATE_NAMES: Any features: Any diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index 06b8032bb5b9..02f9821dd259 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -19,12 +19,12 @@ class AttributeValueWithCharsetSubstitution(str): ... class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution): def __new__(cls, original_value): ... - def encode(self, encoding: str) -> str: ... # type: ignore # incompatible with str + def encode(self, encoding: str) -> str: ... # incompatible with str class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution): CHARSET_RE: Pattern[str] def __new__(cls, original_value): ... - def encode(self, encoding: str) -> str: ... # type: ignore # incompatible with str + def encode(self, encoding: str) -> str: ... # incompatible with str _PageElementT = TypeVar("_PageElementT", bound=PageElement) # The wrapping Union[] can be removed once mypy fully supports | in type aliases. diff --git a/stubs/boto/boto/auth.pyi b/stubs/boto/boto/auth.pyi index 3a588d27ed8e..cf44d1848a10 100644 --- a/stubs/boto/boto/auth.pyi +++ b/stubs/boto/boto/auth.pyi @@ -64,7 +64,7 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys): def signature(self, http_request, string_to_sign): ... def add_auth(self, req, **kwargs): ... -class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): # type: ignore # argument disparities between base classes +class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): # argument disparities between base classes capability: Any region_name: Any def __init__(self, *args, **kwargs) -> None: ... diff --git a/stubs/boto/boto/connection.pyi b/stubs/boto/boto/connection.pyi index c47f7414fba3..3fb565e5fc5e 100644 --- a/stubs/boto/boto/connection.pyi +++ b/stubs/boto/boto/connection.pyi @@ -166,7 +166,9 @@ class AWSQueryConnection(AWSAuthConnection): provider: str = ..., ) -> None: ... def get_utf8_value(self, value): ... - def make_request(self, action, params: Any | None = ..., path: str = ..., verb: str = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 + def make_request( + self, action, params: Any | None = ..., path: str = ..., verb: str = ..., *args, **kwargs + ): ... # https://github.com/python/mypy/issues/1237 def build_list_params(self, params, items, label): ... def build_complex_list_params(self, params, items, label, names): ... def get_list(self, action, params, markers, path: str = ..., parent: Any | None = ..., verb: str = ...): ... diff --git a/stubs/boto/boto/s3/connection.pyi b/stubs/boto/boto/s3/connection.pyi index 239688e52e1d..3a731351fb8c 100644 --- a/stubs/boto/boto/s3/connection.pyi +++ b/stubs/boto/boto/s3/connection.pyi @@ -123,4 +123,17 @@ class S3Connection(AWSAuthConnection): def lookup(self, bucket_name, validate: bool = ..., headers: dict[str, str] | None = ...): ... def create_bucket(self, bucket_name, headers: dict[str, str] | None = ..., location: Any = ..., policy: Any | None = ...): ... def delete_bucket(self, bucket, headers: dict[str, str] | None = ...): ... - def make_request(self, method, bucket: str = ..., key: str = ..., headers: Any | None = ..., data: str = ..., query_args: Any | None = ..., sender: Any | None = ..., override_num_retries: Any | None = ..., retry_handler: Any | None = ..., *args, **kwargs): ... # type: ignore # https://github.com/python/mypy/issues/1237 + def make_request( + self, + method, + bucket: str = ..., + key: str = ..., + headers: Any | None = ..., + data: str = ..., + query_args: Any | None = ..., + sender: Any | None = ..., + override_num_retries: Any | None = ..., + retry_handler: Any | None = ..., + *args, + **kwargs, + ): ... # https://github.com/python/mypy/issues/1237 diff --git a/stubs/filelock/filelock/__init__.pyi b/stubs/filelock/filelock/__init__.pyi index 1d66887f130a..f2595727e013 100644 --- a/stubs/filelock/filelock/__init__.pyi +++ b/stubs/filelock/filelock/__init__.pyi @@ -19,7 +19,7 @@ class BaseFileLock: @property def timeout(self) -> float: ... @timeout.setter - def timeout(self, value: int | str | float) -> None: ... # type: ignore + def timeout(self, value: int | str | float) -> None: ... @property def is_locked(self) -> bool: ... def acquire(self, timeout: float | None = ..., poll_intervall: float = ...) -> _Acquire_ReturnProxy: ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 4e740a303c36..21dc0fae6781 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -275,7 +275,7 @@ class AsyncMockMixin(Base): class AsyncMagicMixin(MagicMixin): def __init__(self, *args: Any, **kw: Any) -> None: ... -class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # type: ignore # argument disparities between base classes +class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # argument disparities between base classes class MagicProxy(Base): name: str diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index 33b47244d385..dad47efe82f4 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -13,7 +13,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): # 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: Self, __m: Self) -> None: ... if sys.version_info >= (3, 0): def items(self) -> ItemsView[str, object]: ... diff --git a/stubs/openpyxl/openpyxl/chart/bar_chart.pyi b/stubs/openpyxl/openpyxl/chart/bar_chart.pyi index 071d36a48184..5f4fd333eb54 100644 --- a/stubs/openpyxl/openpyxl/chart/bar_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/bar_chart.pyi @@ -39,7 +39,7 @@ class BarChart(_BarChartBase): self, gapWidth: int = ..., overlap: Any | None = ..., serLines: Any | None = ..., extLst: Any | None = ..., **kw ) -> None: ... -class BarChart3D(_BarChartBase, _3DBase): # type: ignore # incompatible base classes +class BarChart3D(_BarChartBase, _3DBase): # incompatible base classes tagname: str barDir: Any grouping: Any diff --git a/stubs/openpyxl/openpyxl/chart/surface_chart.pyi b/stubs/openpyxl/openpyxl/chart/surface_chart.pyi index 6b56719342ce..ebdda31d390d 100644 --- a/stubs/openpyxl/openpyxl/chart/surface_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/surface_chart.pyi @@ -30,7 +30,7 @@ class _SurfaceChartBase(ChartBase): @abstractmethod def tagname(self) -> str: ... -class SurfaceChart3D(_SurfaceChartBase, _3DBase): # type: ignore # incompatible base classes +class SurfaceChart3D(_SurfaceChartBase, _3DBase): # incompatible base classes tagname: str wireframe: Any ser: Any diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index 577f7e1113e0..8dac57671e8d 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -27,14 +27,14 @@ class Expression(StrAndRepr): class Literal(Expression): literal: str - identity_tuple: tuple[str, str] # type: ignore + identity_tuple: tuple[str, str] def __init__(self, literal: str, name: str = ...) -> None: ... class TokenMatcher(Literal): ... class Regex(Expression): re: Pattern[str] - identity_tuple: tuple[str, Pattern[str]] # type: ignore + identity_tuple: tuple[str, Pattern[str]] def __init__( self, pattern: str, diff --git a/stubs/parsimonious/parsimonious/grammar.pyi b/stubs/parsimonious/parsimonious/grammar.pyi index 78d21b2d6e93..04002e6a93d0 100644 --- a/stubs/parsimonious/parsimonious/grammar.pyi +++ b/stubs/parsimonious/parsimonious/grammar.pyi @@ -44,7 +44,7 @@ class RuleVisitor(NodeVisitor): def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: typing.Sequence[Any]) -> Literal: ... def visit_regex(self, node: Node, regex: typing.Sequence[Any]) -> Regex: ... def visit_parenthesized(self, node: Node, parenthesized: typing.Sequence[Any]) -> Expression: ... - def generic_visit(self, node: Node, visited_children: typing.Sequence[Any]) -> typing.Sequence[Any] | Node: ... # type: ignore + def generic_visit(self, node: Node, visited_children: typing.Sequence[Any]) -> typing.Sequence[Any] | Node: ... class TokenRuleVisitor(RuleVisitor): def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: typing.Sequence[Any]) -> TokenMatcher: ... diff --git a/stubs/passlib/passlib/handlers/argon2.pyi b/stubs/passlib/passlib/handlers/argon2.pyi index 49f220312dd5..8493a7af3bd8 100644 --- a/stubs/passlib/passlib/handlers/argon2.pyi +++ b/stubs/passlib/passlib/handlers/argon2.pyi @@ -9,7 +9,7 @@ class _DummyCffiHasher: salt_len: int hash_len: int -class _Argon2Common( # type: ignore +class _Argon2Common( uh.SubclassBackendMixin, uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler ): name: str @@ -28,7 +28,7 @@ class _Argon2Common( # type: ignore min_memory_cost: int max_threads: int pure_use_threads: bool - def type_values(cls): ... # type: ignore + def type_values(cls): ... type: Any parallelism: Any version: Any @@ -82,5 +82,5 @@ class _CffiBackend(_Argon2Common): class _PureBackend(_Argon2Common): ... -class argon2(_NoBackend, _Argon2Common): # type: ignore +class argon2(_NoBackend, _Argon2Common): backends: Any diff --git a/stubs/passlib/passlib/handlers/bcrypt.pyi b/stubs/passlib/passlib/handlers/bcrypt.pyi index 34747933cc48..75a58f98c7cc 100644 --- a/stubs/passlib/passlib/handlers/bcrypt.pyi +++ b/stubs/passlib/passlib/handlers/bcrypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_size: int @@ -34,7 +34,7 @@ class _PyBcryptBackend(_BcryptCommon): ... class _OsCryptBackend(_BcryptCommon): ... class _BuiltinBackend(_BcryptCommon): ... -class bcrypt(_NoBackend, _BcryptCommon): # type: ignore +class bcrypt(_NoBackend, _BcryptCommon): backends: Any class _wrapped_bcrypt(bcrypt): diff --git a/stubs/passlib/passlib/handlers/cisco.pyi b/stubs/passlib/passlib/handlers/cisco.pyi index e566bafcc39a..29ad296cda6e 100644 --- a/stubs/passlib/passlib/handlers/cisco.pyi +++ b/stubs/passlib/passlib/handlers/cisco.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class cisco_pix(uh.HasUserContext, uh.StaticHandler): # type: ignore +class cisco_pix(uh.HasUserContext, uh.StaticHandler): name: str truncate_size: int truncate_error: bool diff --git a/stubs/passlib/passlib/handlers/des_crypt.pyi b/stubs/passlib/passlib/handlers/des_crypt.pyi index c7aa16350092..e9817504fe7e 100644 --- a/stubs/passlib/passlib/handlers/des_crypt.pyi +++ b/stubs/passlib/passlib/handlers/des_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHandler): # type: ignore +class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_chars: Any @@ -16,7 +16,7 @@ class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHand def to_string(self): ... backends: Any -class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_size: int @@ -35,7 +35,7 @@ class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler def using(cls, **kwds): ... backends: Any -class bigcrypt(uh.HasSalt, uh.GenericHandler): # type: ignore +class bigcrypt(uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_chars: Any @@ -46,7 +46,7 @@ class bigcrypt(uh.HasSalt, uh.GenericHandler): # type: ignore def from_string(cls, hash): ... def to_string(self): ... -class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore +class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_size: int diff --git a/stubs/passlib/passlib/handlers/django.pyi b/stubs/passlib/passlib/handlers/django.pyi index b6e3bfcf3ac4..56050188a0b9 100644 --- a/stubs/passlib/passlib/handlers/django.pyi +++ b/stubs/passlib/passlib/handlers/django.pyi @@ -4,7 +4,7 @@ import passlib.utils.handlers as uh from passlib.handlers.bcrypt import _wrapped_bcrypt from passlib.ifc import DisabledHash -class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler): # type: ignore +class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler): setting_kwds: Any default_salt_size: ClassVar[int] max_salt_size: Any @@ -14,7 +14,7 @@ class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler): # type: ignore def from_string(cls, hash): ... def to_string(self): ... -class DjangoVariableHash(uh.HasRounds, DjangoSaltedHash): # type: ignore +class DjangoVariableHash(uh.HasRounds, DjangoSaltedHash): setting_kwds: Any min_rounds: int @classmethod @@ -64,7 +64,7 @@ class django_pbkdf2_sha1(django_pbkdf2_sha256): django_argon2: Any -class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore +class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): name: str django_name: str setting_kwds: Any @@ -80,7 +80,7 @@ class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type def from_string(cls, hash): ... def to_string(self): ... -class django_disabled(DisabledHash, uh.StaticHandler): # type: ignore +class django_disabled(DisabledHash, uh.StaticHandler): name: str suffix_length: int @classmethod diff --git a/stubs/passlib/passlib/handlers/fshp.pyi b/stubs/passlib/passlib/handlers/fshp.pyi index e22157f5026f..71f351044bab 100644 --- a/stubs/passlib/passlib/handlers/fshp.pyi +++ b/stubs/passlib/passlib/handlers/fshp.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any checksum_chars: Any diff --git a/stubs/passlib/passlib/handlers/ldap_digests.pyi b/stubs/passlib/passlib/handlers/ldap_digests.pyi index 1a8092bacc71..29ae0fd2d1b2 100644 --- a/stubs/passlib/passlib/handlers/ldap_digests.pyi +++ b/stubs/passlib/passlib/handlers/ldap_digests.pyi @@ -25,7 +25,7 @@ class _Base64DigestHelper(uh.StaticHandler): ident: Any checksum_chars: Any -class _SaltedBase64DigestHelper(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class _SaltedBase64DigestHelper(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): setting_kwds: Any checksum_chars: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/md5_crypt.pyi b/stubs/passlib/passlib/handlers/md5_crypt.pyi index c8497d147967..19fd10c36935 100644 --- a/stubs/passlib/passlib/handlers/md5_crypt.pyi +++ b/stubs/passlib/passlib/handlers/md5_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class _MD5_Common(uh.HasSalt, uh.GenericHandler): # type: ignore +class _MD5_Common(uh.HasSalt, uh.GenericHandler): setting_kwds: Any checksum_size: int checksum_chars: Any @@ -12,7 +12,7 @@ class _MD5_Common(uh.HasSalt, uh.GenericHandler): # type: ignore def from_string(cls, hash): ... def to_string(self): ... -class md5_crypt(uh.HasManyBackends, _MD5_Common): # type: ignore +class md5_crypt(uh.HasManyBackends, _MD5_Common): name: str ident: Any backends: Any diff --git a/stubs/passlib/passlib/handlers/misc.pyi b/stubs/passlib/passlib/handlers/misc.pyi index adb1b27c080b..d9721c502e5b 100644 --- a/stubs/passlib/passlib/handlers/misc.pyi +++ b/stubs/passlib/passlib/handlers/misc.pyi @@ -3,7 +3,7 @@ from typing import Any import passlib.utils.handlers as uh from passlib.ifc import DisabledHash -class unix_fallback(DisabledHash, uh.StaticHandler): # type: ignore +class unix_fallback(DisabledHash, uh.StaticHandler): name: str context_kwds: Any @classmethod @@ -13,7 +13,7 @@ class unix_fallback(DisabledHash, uh.StaticHandler): # type: ignore @classmethod def verify(cls, secret, hash, enable_wildcard: bool = ...): ... # type: ignore[override] -class unix_disabled(DisabledHash, uh.MinimalHandler): # type: ignore +class unix_disabled(DisabledHash, uh.MinimalHandler): name: str setting_kwds: Any context_kwds: Any diff --git a/stubs/passlib/passlib/handlers/mssql.pyi b/stubs/passlib/passlib/handlers/mssql.pyi index b3c1b8670c59..9f8dd2b32b7a 100644 --- a/stubs/passlib/passlib/handlers/mssql.pyi +++ b/stubs/passlib/passlib/handlers/mssql.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class mssql2000(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class mssql2000(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any checksum_size: int @@ -16,7 +16,7 @@ class mssql2000(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: i @classmethod def verify(cls, secret, hash): ... -class mssql2005(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class mssql2005(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any checksum_size: int diff --git a/stubs/passlib/passlib/handlers/oracle.pyi b/stubs/passlib/passlib/handlers/oracle.pyi index 00af0b30d60d..96344e1811a8 100644 --- a/stubs/passlib/passlib/handlers/oracle.pyi +++ b/stubs/passlib/passlib/handlers/oracle.pyi @@ -2,12 +2,12 @@ from typing import Any import passlib.utils.handlers as uh -class oracle10(uh.HasUserContext, uh.StaticHandler): # type: ignore +class oracle10(uh.HasUserContext, uh.StaticHandler): name: str checksum_chars: Any checksum_size: int -class oracle11(uh.HasSalt, uh.GenericHandler): # type: ignore +class oracle11(uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_size: int diff --git a/stubs/passlib/passlib/handlers/pbkdf2.pyi b/stubs/passlib/passlib/handlers/pbkdf2.pyi index a42dc0ff6873..0b5affec73ae 100644 --- a/stubs/passlib/passlib/handlers/pbkdf2.pyi +++ b/stubs/passlib/passlib/handlers/pbkdf2.pyi @@ -3,7 +3,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh from passlib.utils.handlers import PrefixWrapper -class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): setting_kwds: Any checksum_chars: Any default_salt_size: ClassVar[int] @@ -41,7 +41,7 @@ ldap_pbkdf2_sha1: PrefixWrapper ldap_pbkdf2_sha256: PrefixWrapper ldap_pbkdf2_sha512: PrefixWrapper -class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any ident: Any @@ -56,7 +56,7 @@ class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Generic def from_string(cls, hash): ... def to_string(self): ... -class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any ident: Any @@ -71,7 +71,7 @@ class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: i def from_string(cls, hash): ... def to_string(self): ... -class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any ident: Any @@ -82,7 +82,7 @@ class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler) def from_string(cls, hash): ... def to_string(self): ... -class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/phpass.pyi b/stubs/passlib/passlib/handlers/phpass.pyi index 0f0327682beb..154e34e4812c 100644 --- a/stubs/passlib/passlib/handlers/phpass.pyi +++ b/stubs/passlib/passlib/handlers/phpass.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_chars: Any diff --git a/stubs/passlib/passlib/handlers/postgres.pyi b/stubs/passlib/passlib/handlers/postgres.pyi index 2295654088e6..dd9419c29e6c 100644 --- a/stubs/passlib/passlib/handlers/postgres.pyi +++ b/stubs/passlib/passlib/handlers/postgres.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class postgres_md5(uh.HasUserContext, uh.StaticHandler): # type: ignore +class postgres_md5(uh.HasUserContext, uh.StaticHandler): name: str checksum_chars: Any checksum_size: int diff --git a/stubs/passlib/passlib/handlers/scram.pyi b/stubs/passlib/passlib/handlers/scram.pyi index fb653b60755e..15c4e2d371e6 100644 --- a/stubs/passlib/passlib/handlers/scram.pyi +++ b/stubs/passlib/passlib/handlers/scram.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore +class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): name: str setting_kwds: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/scrypt.pyi b/stubs/passlib/passlib/handlers/scrypt.pyi index 9c7731c2a25a..5258f7c890b3 100644 --- a/stubs/passlib/passlib/handlers/scrypt.pyi +++ b/stubs/passlib/passlib/handlers/scrypt.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.HasManyIdents, uh.GenericHandler): # type: ignore +class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.HasManyIdents, uh.GenericHandler): backends: ClassVar[tuple[str, ...]] name: str setting_kwds: Any diff --git a/stubs/passlib/passlib/handlers/sha1_crypt.pyi b/stubs/passlib/passlib/handlers/sha1_crypt.pyi index 159065055601..c56c6683cbad 100644 --- a/stubs/passlib/passlib/handlers/sha1_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha1_crypt.pyi @@ -4,7 +4,7 @@ import passlib.utils.handlers as uh log: Any -class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/sha2_crypt.pyi b/stubs/passlib/passlib/handlers/sha2_crypt.pyi index 417f0ae9cf1e..3fb8240a54bd 100644 --- a/stubs/passlib/passlib/handlers/sha2_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha2_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): setting_kwds: Any checksum_chars: Any max_salt_size: int diff --git a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi index 5e699bc2037e..5d25e418ed41 100644 --- a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore +class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): name: str setting_kwds: Any checksum_chars: Any diff --git a/stubs/passlib/passlib/handlers/windows.pyi b/stubs/passlib/passlib/handlers/windows.pyi index 5b95bcad396e..9c96b3b0c6a9 100644 --- a/stubs/passlib/passlib/handlers/windows.pyi +++ b/stubs/passlib/passlib/handlers/windows.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class lmhash(uh.TruncateMixin, uh.HasEncodingContext, uh.StaticHandler): # type: ignore +class lmhash(uh.TruncateMixin, uh.HasEncodingContext, uh.StaticHandler): name: str setting_kwds: Any checksum_chars: Any @@ -23,14 +23,14 @@ class nthash(uh.StaticHandler): bsd_nthash: Any -class msdcc(uh.HasUserContext, uh.StaticHandler): # type: ignore +class msdcc(uh.HasUserContext, uh.StaticHandler): name: str checksum_chars: Any checksum_size: int @classmethod def raw(cls, secret, user): ... -class msdcc2(uh.HasUserContext, uh.StaticHandler): # type: ignore +class msdcc2(uh.HasUserContext, uh.StaticHandler): name: str checksum_chars: Any checksum_size: int diff --git a/stubs/passlib/passlib/totp.pyi b/stubs/passlib/passlib/totp.pyi index f44e3e383904..0f9160282f95 100644 --- a/stubs/passlib/passlib/totp.pyi +++ b/stubs/passlib/passlib/totp.pyi @@ -78,7 +78,7 @@ class TOTP: def pretty_key(self, format: str = ..., sep: str = ...): ... @classmethod def normalize_time(cls, time): ... - def normalize_token(self_or_cls, token): ... # type: ignore + def normalize_token(self_or_cls, token): ... def generate(self, time: Any | None = ...): ... @classmethod def verify(cls, token, source, **kwds): ... diff --git a/stubs/passlib/passlib/utils/handlers.pyi b/stubs/passlib/passlib/utils/handlers.pyi index 2af68330ee54..0d7670b0232c 100644 --- a/stubs/passlib/passlib/utils/handlers.pyi +++ b/stubs/passlib/passlib/utils/handlers.pyi @@ -148,7 +148,7 @@ class BackendMixin(PasswordHash, metaclass=abc.ABCMeta): def set_backend(cls, name: str = ..., dryrun: bool = ...): ... class SubclassBackendMixin(BackendMixin, metaclass=abc.ABCMeta): ... -class HasManyBackends(BackendMixin, GenericHandler): ... # type: ignore +class HasManyBackends(BackendMixin, GenericHandler): ... class PrefixWrapper: name: Any diff --git a/stubs/polib/polib.pyi b/stubs/polib/polib.pyi index a9f9f5bebd65..2e3e0bee6751 100644 --- a/stubs/polib/polib.pyi +++ b/stubs/polib/polib.pyi @@ -33,7 +33,7 @@ class _BaseFile(list[_TB]): metadata_is_fuzzy: bool def __init__(self, *args: Any, **kwargs: Any) -> None: ... def __unicode__(self) -> Text: ... - def __contains__(self, entry: _TB) -> bool: ... # type: ignore # AttributeError otherwise + def __contains__(self, entry: _TB) -> bool: ... # AttributeError otherwise def __eq__(self, other: object) -> bool: ... def append(self, entry: _TB) -> None: ... def insert(self, index: SupportsIndex, entry: _TB) -> None: ... @@ -60,7 +60,7 @@ class MOFile(_BaseFile[MOEntry]): version: int def __init__(self, *args: Any, **kwargs: Any) -> None: ... def save_as_pofile(self, fpath: str) -> None: ... - def save(self, fpath: Text | None = ...) -> None: ... # type: ignore # binary file does not allow argument repr_method + def save(self, fpath: Text | None = ...) -> None: ... # binary file does not allow argument repr_method def percent_translated(self) -> int: ... def translated_entries(self) -> list[MOEntry]: ... def untranslated_entries(self) -> list[MOEntry]: ... From 1fc1cb6e64a555605a8a564a9f7bce01044e498f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 17 Mar 2022 09:36:12 +0000 Subject: [PATCH 2/8] Add mypy error codes to `type: ignore`s, remove unused ignores --- stdlib/@python2/__builtin__.pyi | 28 +++++++++---------- stdlib/@python2/_msi.pyi | 16 +++++------ stdlib/@python2/argparse.pyi | 4 +-- stdlib/@python2/array.pyi | 2 +- stdlib/@python2/builtins.pyi | 28 +++++++++---------- stdlib/@python2/bz2.pyi | 2 +- stdlib/@python2/codecs.pyi | 4 +-- stdlib/@python2/ctypes/__init__.pyi | 4 +-- stdlib/@python2/datetime.pyi | 10 +++---- stdlib/@python2/dbm/gnu.pyi | 4 +-- stdlib/@python2/dbm/ndbm.pyi | 4 +-- stdlib/@python2/difflib.pyi | 2 +- stdlib/@python2/genericpath.pyi | 2 +- stdlib/@python2/inspect.pyi | 2 +- stdlib/@python2/logging/handlers.pyi | 2 +- stdlib/@python2/smtpd.pyi | 4 +-- stdlib/@python2/turtle.pyi | 8 +++--- stdlib/@python2/xml/dom/minicompat.pyi | 2 +- stdlib/@python2/xmlrpclib.pyi | 4 +-- stdlib/@python2/zipfile.pyi | 2 +- stubs/Flask-Cors/flask_cors/core.pyi | 2 +- stubs/beautifulsoup4/bs4/__init__.pyi | 2 +- .../beautifulsoup4/bs4/builder/_html5lib.pyi | 2 +- stubs/beautifulsoup4/bs4/builder/_lxml.pyi | 2 +- stubs/beautifulsoup4/bs4/element.pyi | 4 +-- stubs/boto/boto/connection.pyi | 2 +- stubs/boto/boto/s3/connection.pyi | 2 +- .../parsimonious/parsimonious/expressions.pyi | 4 +-- stubs/parsimonious/parsimonious/grammar.pyi | 2 +- stubs/passlib/passlib/handlers/argon2.pyi | 4 +-- stubs/passlib/passlib/handlers/bcrypt.pyi | 4 +-- stubs/passlib/passlib/handlers/des_crypt.pyi | 6 ++-- stubs/passlib/passlib/handlers/django.pyi | 4 +-- stubs/passlib/passlib/handlers/fshp.pyi | 2 +- stubs/passlib/passlib/handlers/pbkdf2.pyi | 8 +++--- stubs/passlib/passlib/handlers/phpass.pyi | 2 +- stubs/passlib/passlib/handlers/scram.pyi | 2 +- stubs/passlib/passlib/handlers/scrypt.pyi | 2 +- stubs/passlib/passlib/handlers/sha1_crypt.pyi | 2 +- stubs/passlib/passlib/handlers/sha2_crypt.pyi | 2 +- .../passlib/handlers/sun_md5_crypt.pyi | 2 +- stubs/polib/polib.pyi | 4 +-- 42 files changed, 100 insertions(+), 100 deletions(-) diff --git a/stdlib/@python2/__builtin__.pyi b/stdlib/@python2/__builtin__.pyi index c2477d5f4501..7213bd77036b 100644 --- a/stdlib/@python2/__builtin__.pyi +++ b/stdlib/@python2/__builtin__.pyi @@ -336,7 +336,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: ... + def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore[override] def __iter__(self) -> Iterator[unicode]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... @@ -414,7 +414,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: ... + 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: ... @@ -490,7 +490,7 @@ class bytearray(MutableSequence[int], ByteString): def __iter__(self) -> Iterator[int]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... - __hash__: None + __hash__: None # type: ignore[assignment] @overload def __getitem__(self, i: int) -> int: ... @overload @@ -506,7 +506,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: ... + 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: ... @@ -574,7 +574,7 @@ class slice(object): def __init__(self, stop: Any) -> None: ... @overload def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... - __hash__: None + __hash__: None # type: ignore[assignment] def indices(self, len: int) -> tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): @@ -621,7 +621,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__: None + __hash__: None # type: ignore[assignment] @overload def __getitem__(self, i: int) -> _T: ... @overload @@ -683,7 +683,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__: None + __hash__: None # type: ignore[assignment] class set(MutableSet[_T], Generic[_T]): def __init__(self, iterable: Iterable[_T] = ...) -> None: ... @@ -715,7 +715,7 @@ class set(MutableSet[_T], Generic[_T]): def __sub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __sub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... - @overload + @overload # type: ignore def __isub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __isub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... @@ -725,7 +725,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__: None + __hash__: None # type: ignore[assignment] class frozenset(AbstractSet[_T_co], Generic[_T_co]): def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... @@ -784,10 +784,10 @@ class property(object): long = int -class _NotImplementedType(Any): +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 + __call__: NotImplemented # type: ignore[valid-type] NotImplemented: _NotImplementedType @@ -816,11 +816,11 @@ def eval( def execfile(__filename: str, __globals: dict[str, Any] | None = ..., __locals: dict[str, Any] | None = ...) -> None: ... def exit(code: object = ...) -> NoReturn: ... @overload -def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... +def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore @overload -def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... +def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... # type: ignore @overload -def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... +def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... # type: ignore @overload def filter(__function: None, __iterable: Iterable[_T | None]) -> list[_T]: ... @overload diff --git a/stdlib/@python2/_msi.pyi b/stdlib/@python2/_msi.pyi index 84bd2fd915bb..b7e852f38ae9 100644 --- a/stdlib/@python2/_msi.pyi +++ b/stdlib/@python2/_msi.pyi @@ -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 - __init__: None + __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 - __init__: None + __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 - __init__: None + __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 - __init__: None + __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: ... diff --git a/stdlib/@python2/argparse.pyi b/stdlib/@python2/argparse.pyi index 698c662db9c9..a9a57ea0ea55 100644 --- a/stdlib/@python2/argparse.pyi +++ b/stdlib/@python2/argparse.pyi @@ -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: ... + 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: ... + def parse_args(self, *, namespace: None) -> Namespace: ... # type: ignore[misc] @overload def parse_args(self, *, namespace: _N) -> _N: ... def add_subparsers( diff --git a/stdlib/@python2/array.pyi b/stdlib/@python2/array.pyi index 1ff2e3f96f0e..a47b845d1933 100644 --- a/stdlib/@python2/array.pyi +++ b/stdlib/@python2/array.pyi @@ -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 # Overrides MutableSequence + @overload # type: ignore[override] def __setitem__(self, i: int, o: _T) -> None: ... @overload def __setitem__(self, s: slice, o: array[_T]) -> None: ... diff --git a/stdlib/@python2/builtins.pyi b/stdlib/@python2/builtins.pyi index c2477d5f4501..7213bd77036b 100644 --- a/stdlib/@python2/builtins.pyi +++ b/stdlib/@python2/builtins.pyi @@ -336,7 +336,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: ... + def __contains__(self, s: unicode | bytes) -> bool: ... # type: ignore[override] def __iter__(self) -> Iterator[unicode]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... @@ -414,7 +414,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: ... + 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: ... @@ -490,7 +490,7 @@ class bytearray(MutableSequence[int], ByteString): def __iter__(self) -> Iterator[int]: ... def __int__(self) -> int: ... def __float__(self) -> float: ... - __hash__: None + __hash__: None # type: ignore[assignment] @overload def __getitem__(self, i: int) -> int: ... @overload @@ -506,7 +506,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: ... + 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: ... @@ -574,7 +574,7 @@ class slice(object): def __init__(self, stop: Any) -> None: ... @overload def __init__(self, start: Any, stop: Any, step: Any = ...) -> None: ... - __hash__: None + __hash__: None # type: ignore[assignment] def indices(self, len: int) -> tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): @@ -621,7 +621,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__: None + __hash__: None # type: ignore[assignment] @overload def __getitem__(self, i: int) -> _T: ... @overload @@ -683,7 +683,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__: None + __hash__: None # type: ignore[assignment] class set(MutableSet[_T], Generic[_T]): def __init__(self, iterable: Iterable[_T] = ...) -> None: ... @@ -715,7 +715,7 @@ class set(MutableSet[_T], Generic[_T]): def __sub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __sub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... - @overload + @overload # type: ignore def __isub__(self: set[str], s: AbstractSet[Text | None]) -> set[_T]: ... @overload def __isub__(self, s: AbstractSet[_T | None]) -> set[_T]: ... @@ -725,7 +725,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__: None + __hash__: None # type: ignore[assignment] class frozenset(AbstractSet[_T_co], Generic[_T_co]): def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... @@ -784,10 +784,10 @@ class property(object): long = int -class _NotImplementedType(Any): +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 + __call__: NotImplemented # type: ignore[valid-type] NotImplemented: _NotImplementedType @@ -816,11 +816,11 @@ def eval( def execfile(__filename: str, __globals: dict[str, Any] | None = ..., __locals: dict[str, Any] | None = ...) -> None: ... def exit(code: object = ...) -> NoReturn: ... @overload -def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... +def filter(__function: Callable[[AnyStr], Any], __iterable: AnyStr) -> AnyStr: ... # type: ignore @overload -def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... +def filter(__function: None, __iterable: tuple[_T | None, ...]) -> tuple[_T, ...]: ... # type: ignore @overload -def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... +def filter(__function: Callable[[_T], Any], __iterable: tuple[_T, ...]) -> tuple[_T, ...]: ... # type: ignore @overload def filter(__function: None, __iterable: Iterable[_T | None]) -> list[_T]: ... @overload diff --git a/stdlib/@python2/bz2.pyi b/stdlib/@python2/bz2.pyi index cbb5ebecf5e5..95377347cce8 100644 --- a/stdlib/@python2/bz2.pyi +++ b/stdlib/@python2/bz2.pyi @@ -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: ... + 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: ... diff --git a/stdlib/@python2/codecs.pyi b/stdlib/@python2/codecs.pyi index 6d3c49197886..9ed83567c148 100644 --- a/stdlib/@python2/codecs.pyi +++ b/stdlib/@python2/codecs.pyi @@ -59,7 +59,7 @@ def encode(obj: str, encoding: Literal["rot13", "rot_13"] = ..., errors: str = . @overload def encode(obj: _Decoded, encoding: str = ..., errors: str = ...) -> _Encoded: ... @overload -def decode(obj: bytes, encoding: _BytesToBytesEncodingT, errors: str = ...) -> bytes: ... +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: ... # 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: ... diff --git a/stdlib/@python2/ctypes/__init__.pyi b/stdlib/@python2/ctypes/__init__.pyi index 4493ecca323a..0fc23cb09b5b 100644 --- a/stdlib/@python2/ctypes/__init__.pyi +++ b/stdlib/@python2/ctypes/__init__.pyi @@ -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]]: ... - def __rmul__(cls: type[_CT], other: int) -> type[Array[_CT]]: ... + 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 = ... diff --git a/stdlib/@python2/datetime.pyi b/stdlib/@python2/datetime.pyi index 1ca4cd436bef..62791461c885 100644 --- a/stdlib/@python2/datetime.pyi +++ b/stdlib/@python2/datetime.pyi @@ -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: ... - def __lt__(self, other: datetime) -> bool: ... - def __ge__(self, other: datetime) -> bool: ... - def __gt__(self, other: datetime) -> bool: ... + 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 + @overload # type: ignore[override] def __sub__(self, other: datetime) -> timedelta: ... @overload def __sub__(self, other: timedelta) -> datetime: ... diff --git a/stdlib/@python2/dbm/gnu.pyi b/stdlib/@python2/dbm/gnu.pyi index 321219994d94..c6eed0be2098 100644 --- a/stdlib/@python2/dbm/gnu.pyi +++ b/stdlib/@python2/dbm/gnu.pyi @@ -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 - __init__: None + __new__: None # type: ignore[assignment] + __init__: None # type: ignore[assignment] def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _gdbm: ... diff --git a/stdlib/@python2/dbm/ndbm.pyi b/stdlib/@python2/dbm/ndbm.pyi index 12ecf4b397f2..764aed01a357 100644 --- a/stdlib/@python2/dbm/ndbm.pyi +++ b/stdlib/@python2/dbm/ndbm.pyi @@ -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 - __init__: None + __new__: None # type: ignore[assignment] + __init__: None # type: ignore[assignment] def open(__filename: str, __flags: str = ..., __mode: int = ...) -> _dbm: ... diff --git a/stdlib/@python2/difflib.pyi b/stdlib/@python2/difflib.pyi index 32cfc9c42aeb..f4214cec2260 100644 --- a/stdlib/@python2/difflib.pyi +++ b/stdlib/@python2/difflib.pyi @@ -29,7 +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(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 = ... diff --git a/stdlib/@python2/genericpath.pyi b/stdlib/@python2/genericpath.pyi index ca0073d75c2f..7ff27a62f959 100644 --- a/stdlib/@python2/genericpath.pyi +++ b/stdlib/@python2/genericpath.pyi @@ -6,7 +6,7 @@ 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[""]: ... +def commonprefix(m: Sequence[str]) -> str | Literal[""]: ... # type: ignore[misc] @overload def commonprefix(m: Sequence[Text]) -> Text: ... @overload diff --git a/stdlib/@python2/inspect.pyi b/stdlib/@python2/inspect.pyi index 9cd3b6606e8e..06912867cf21 100644 --- a/stdlib/@python2/inspect.pyi +++ b/stdlib/@python2/inspect.pyi @@ -104,7 +104,7 @@ class Traceback(NamedTuple): lineno: int function: str code_context: list[str] | None - index: int | None + index: int | None # type: ignore[assignment] _FrameInfo = tuple[FrameType, str, int, str, Optional[list[str]], Optional[int]] diff --git a/stdlib/@python2/logging/handlers.pyi b/stdlib/@python2/logging/handlers.pyi index 2b69096f6d82..212980e32ac6 100644 --- a/stdlib/@python2/logging/handlers.pyi +++ b/stdlib/@python2/logging/handlers.pyi @@ -52,7 +52,7 @@ class SocketHandler(Handler): def createSocket(self) -> None: ... class DatagramHandler(SocketHandler): - def makeSocket(self) -> SocketType: ... + def makeSocket(self) -> SocketType: ... # type: ignore[override] class SysLogHandler(Handler): LOG_EMERG: int diff --git a/stdlib/@python2/smtpd.pyi b/stdlib/@python2/smtpd.pyi index 791621979144..6fc8b52f4b47 100644 --- a/stdlib/@python2/smtpd.pyi +++ b/stdlib/@python2/smtpd.pyi @@ -35,7 +35,7 @@ class SMTPServer(asyncore.dispatcher): class DebuggingServer(SMTPServer): ... class PureProxy(SMTPServer): - def process_message(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(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] diff --git a/stdlib/@python2/turtle.pyi b/stdlib/@python2/turtle.pyi index ecc34282b61a..037b9851381f 100644 --- a/stdlib/@python2/turtle.pyi +++ b/stdlib/@python2/turtle.pyi @@ -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: ... + 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]: ... + 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: ... +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]: ... +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: ... diff --git a/stdlib/@python2/xml/dom/minicompat.pyi b/stdlib/@python2/xml/dom/minicompat.pyi index 02c2c532d9dd..e37b7cd89176 100644 --- a/stdlib/@python2/xml/dom/minicompat.pyi +++ b/stdlib/@python2/xml/dom/minicompat.pyi @@ -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]: ... + 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: ... diff --git a/stdlib/@python2/xmlrpclib.pyi b/stdlib/@python2/xmlrpclib.pyi index 80fc8e086a11..2365bcf90cd1 100644 --- a/stdlib/@python2/xmlrpclib.pyi +++ b/stdlib/@python2/xmlrpclib.pyi @@ -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: ... - def __ne__(self, other: _dateTimeComp) -> bool: ... + 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: ... diff --git a/stdlib/@python2/zipfile.pyi b/stdlib/@python2/zipfile.pyi index ebcaf23c118e..63c93b482855 100644 --- a/stdlib/@python2/zipfile.pyi +++ b/stdlib/@python2/zipfile.pyi @@ -30,7 +30,7 @@ class ZipExtFile(io.BufferedIOBase): close_fileobj: bool = ..., ) -> None: ... def read(self, n: int | None = ...) -> bytes: ... - def readline(self, limit: int = ...) -> bytes: ... + def readline(self, limit: int = ...) -> bytes: ... # type: ignore[override] def peek(self, n: int = ...) -> bytes: ... def read1(self, n: int | None) -> bytes: ... diff --git a/stubs/Flask-Cors/flask_cors/core.pyi b/stubs/Flask-Cors/flask_cors/core.pyi index 2140105cfd46..083a653b14cd 100644 --- a/stubs/Flask-Cors/flask_cors/core.pyi +++ b/stubs/Flask-Cors/flask_cors/core.pyi @@ -53,7 +53,7 @@ def get_app_kwarg_dict(appInstance: _App | None = ...) -> _Options: ... def flexible_str(obj: object) -> str | None: ... def serialize_option(options_dict: _Options, key: str, upper: bool = ...) -> None: ... @overload -def ensure_iterable(inst: str) -> list[str]: ... +def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[misc] @overload def ensure_iterable(inst: _IterableT) -> _IterableT: ... @overload diff --git a/stubs/beautifulsoup4/bs4/__init__.pyi b/stubs/beautifulsoup4/bs4/__init__.pyi index 9f6639df3c7e..9245aba7327b 100644 --- a/stubs/beautifulsoup4/bs4/__init__.pyi +++ b/stubs/beautifulsoup4/bs4/__init__.pyi @@ -74,7 +74,7 @@ class BeautifulSoup(Tag): def handle_starttag(self, name, namespace, nsprefix, attrs, sourceline: Any | None = ..., sourcepos: Any | None = ...): ... def handle_endtag(self, name, nsprefix: Any | None = ...) -> None: ... def handle_data(self, data) -> None: ... - def decode( + def decode( # type: ignore[override] self, pretty_print: bool = ..., eventual_encoding: str = ..., formatter: str | Formatter = ... ): ... # missing some arguments diff --git a/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi b/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi index cfc51983b855..bf2032865d24 100644 --- a/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi +++ b/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi @@ -7,7 +7,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder): features: Any TRACKS_LINE_NUMBERS: bool user_specified_encoding: Any - def prepare_markup( # user_specified_encoding doesn't have a default + def prepare_markup( # type: ignore[override] # user_specified_encoding doesn't have a default self, markup, user_specified_encoding, document_declared_encoding: Any | None = ..., exclude_encodings: Any | None = ... ) -> None: ... def feed(self, markup) -> None: ... diff --git a/stubs/beautifulsoup4/bs4/builder/_lxml.pyi b/stubs/beautifulsoup4/bs4/builder/_lxml.pyi index db631456d045..3c9b8694eafb 100644 --- a/stubs/beautifulsoup4/bs4/builder/_lxml.pyi +++ b/stubs/beautifulsoup4/bs4/builder/_lxml.pyi @@ -19,7 +19,7 @@ class LXMLTreeBuilderForXML(TreeBuilder): soup: Any nsmaps: Any def __init__(self, parser: Any | None = ..., empty_element_tags: Any | None = ..., **kwargs) -> None: ... - def prepare_markup( # the order of the parameters is different + def prepare_markup( # type: ignore[override] # the order of the parameters is different self, markup, user_specified_encoding: Any | None = ..., diff --git a/stubs/beautifulsoup4/bs4/element.pyi b/stubs/beautifulsoup4/bs4/element.pyi index 02f9821dd259..e55034475098 100644 --- a/stubs/beautifulsoup4/bs4/element.pyi +++ b/stubs/beautifulsoup4/bs4/element.pyi @@ -19,12 +19,12 @@ class AttributeValueWithCharsetSubstitution(str): ... class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution): def __new__(cls, original_value): ... - def encode(self, encoding: str) -> str: ... # incompatible with str + def encode(self, encoding: str) -> str: ... # type: ignore[override] # incompatible with str class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution): CHARSET_RE: Pattern[str] def __new__(cls, original_value): ... - def encode(self, encoding: str) -> str: ... # incompatible with str + def encode(self, encoding: str) -> str: ... # type: ignore[override] # incompatible with str _PageElementT = TypeVar("_PageElementT", bound=PageElement) # The wrapping Union[] can be removed once mypy fully supports | in type aliases. diff --git a/stubs/boto/boto/connection.pyi b/stubs/boto/boto/connection.pyi index 3fb565e5fc5e..3cbecf879f75 100644 --- a/stubs/boto/boto/connection.pyi +++ b/stubs/boto/boto/connection.pyi @@ -166,7 +166,7 @@ class AWSQueryConnection(AWSAuthConnection): provider: str = ..., ) -> None: ... def get_utf8_value(self, value): ... - def make_request( + def make_request( # type: ignore[override] self, action, params: Any | None = ..., path: str = ..., verb: str = ..., *args, **kwargs ): ... # https://github.com/python/mypy/issues/1237 def build_list_params(self, params, items, label): ... diff --git a/stubs/boto/boto/s3/connection.pyi b/stubs/boto/boto/s3/connection.pyi index 3a731351fb8c..d9a612540fb3 100644 --- a/stubs/boto/boto/s3/connection.pyi +++ b/stubs/boto/boto/s3/connection.pyi @@ -123,7 +123,7 @@ class S3Connection(AWSAuthConnection): def lookup(self, bucket_name, validate: bool = ..., headers: dict[str, str] | None = ...): ... def create_bucket(self, bucket_name, headers: dict[str, str] | None = ..., location: Any = ..., policy: Any | None = ...): ... def delete_bucket(self, bucket, headers: dict[str, str] | None = ...): ... - def make_request( + def make_request( # type: ignore[override] self, method, bucket: str = ..., diff --git a/stubs/parsimonious/parsimonious/expressions.pyi b/stubs/parsimonious/parsimonious/expressions.pyi index 8dac57671e8d..9818c6a1b167 100644 --- a/stubs/parsimonious/parsimonious/expressions.pyi +++ b/stubs/parsimonious/parsimonious/expressions.pyi @@ -27,14 +27,14 @@ class Expression(StrAndRepr): class Literal(Expression): literal: str - identity_tuple: tuple[str, str] + identity_tuple: tuple[str, str] # type: ignore[assignment] def __init__(self, literal: str, name: str = ...) -> None: ... class TokenMatcher(Literal): ... class Regex(Expression): re: Pattern[str] - identity_tuple: tuple[str, Pattern[str]] + identity_tuple: tuple[str, Pattern[str]] # type: ignore[assignment] def __init__( self, pattern: str, diff --git a/stubs/parsimonious/parsimonious/grammar.pyi b/stubs/parsimonious/parsimonious/grammar.pyi index 04002e6a93d0..2b6e012669b8 100644 --- a/stubs/parsimonious/parsimonious/grammar.pyi +++ b/stubs/parsimonious/parsimonious/grammar.pyi @@ -44,7 +44,7 @@ class RuleVisitor(NodeVisitor): def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: typing.Sequence[Any]) -> Literal: ... def visit_regex(self, node: Node, regex: typing.Sequence[Any]) -> Regex: ... def visit_parenthesized(self, node: Node, parenthesized: typing.Sequence[Any]) -> Expression: ... - def generic_visit(self, node: Node, visited_children: typing.Sequence[Any]) -> typing.Sequence[Any] | Node: ... + def generic_visit(self, node: Node, visited_children: typing.Sequence[Any]) -> typing.Sequence[Any] | Node: ... # type: ignore[override] class TokenRuleVisitor(RuleVisitor): def visit_spaceless_literal(self, spaceless_literal: Node, visited_children: typing.Sequence[Any]) -> TokenMatcher: ... diff --git a/stubs/passlib/passlib/handlers/argon2.pyi b/stubs/passlib/passlib/handlers/argon2.pyi index 8493a7af3bd8..afa23cc56d3a 100644 --- a/stubs/passlib/passlib/handlers/argon2.pyi +++ b/stubs/passlib/passlib/handlers/argon2.pyi @@ -9,7 +9,7 @@ class _DummyCffiHasher: salt_len: int hash_len: int -class _Argon2Common( +class _Argon2Common( # type: ignore[misc] uh.SubclassBackendMixin, uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler ): name: str @@ -82,5 +82,5 @@ class _CffiBackend(_Argon2Common): class _PureBackend(_Argon2Common): ... -class argon2(_NoBackend, _Argon2Common): +class argon2(_NoBackend, _Argon2Common): # type: ignore[misc] backends: Any diff --git a/stubs/passlib/passlib/handlers/bcrypt.pyi b/stubs/passlib/passlib/handlers/bcrypt.pyi index 75a58f98c7cc..6abdcdf2e0a6 100644 --- a/stubs/passlib/passlib/handlers/bcrypt.pyi +++ b/stubs/passlib/passlib/handlers/bcrypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class _BcryptCommon(uh.SubclassBackendMixin, uh.TruncateMixin, uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_size: int @@ -34,7 +34,7 @@ class _PyBcryptBackend(_BcryptCommon): ... class _OsCryptBackend(_BcryptCommon): ... class _BuiltinBackend(_BcryptCommon): ... -class bcrypt(_NoBackend, _BcryptCommon): +class bcrypt(_NoBackend, _BcryptCommon): # type: ignore[misc] backends: Any class _wrapped_bcrypt(bcrypt): diff --git a/stubs/passlib/passlib/handlers/des_crypt.pyi b/stubs/passlib/passlib/handlers/des_crypt.pyi index e9817504fe7e..f67a508f9eab 100644 --- a/stubs/passlib/passlib/handlers/des_crypt.pyi +++ b/stubs/passlib/passlib/handlers/des_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHandler): +class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_chars: Any @@ -16,7 +16,7 @@ class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHand def to_string(self): ... backends: Any -class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_size: int @@ -46,7 +46,7 @@ class bigcrypt(uh.HasSalt, uh.GenericHandler): def from_string(cls, hash): ... def to_string(self): ... -class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): +class crypt16(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_size: int diff --git a/stubs/passlib/passlib/handlers/django.pyi b/stubs/passlib/passlib/handlers/django.pyi index 56050188a0b9..57cc2b0f4deb 100644 --- a/stubs/passlib/passlib/handlers/django.pyi +++ b/stubs/passlib/passlib/handlers/django.pyi @@ -14,7 +14,7 @@ class DjangoSaltedHash(uh.HasSalt, uh.GenericHandler): def from_string(cls, hash): ... def to_string(self): ... -class DjangoVariableHash(uh.HasRounds, DjangoSaltedHash): +class DjangoVariableHash(uh.HasRounds, DjangoSaltedHash): # type: ignore[misc] setting_kwds: Any min_rounds: int @classmethod @@ -64,7 +64,7 @@ class django_pbkdf2_sha1(django_pbkdf2_sha256): django_argon2: Any -class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): +class django_des_crypt(uh.TruncateMixin, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str django_name: str setting_kwds: Any diff --git a/stubs/passlib/passlib/handlers/fshp.pyi b/stubs/passlib/passlib/handlers/fshp.pyi index 71f351044bab..290445b85cfd 100644 --- a/stubs/passlib/passlib/handlers/fshp.pyi +++ b/stubs/passlib/passlib/handlers/fshp.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): +class fshp(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_chars: Any diff --git a/stubs/passlib/passlib/handlers/pbkdf2.pyi b/stubs/passlib/passlib/handlers/pbkdf2.pyi index 0b5affec73ae..b2b9920e0f5d 100644 --- a/stubs/passlib/passlib/handlers/pbkdf2.pyi +++ b/stubs/passlib/passlib/handlers/pbkdf2.pyi @@ -3,7 +3,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh from passlib.utils.handlers import PrefixWrapper -class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): +class Pbkdf2DigestHandler(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc] setting_kwds: Any checksum_chars: Any default_salt_size: ClassVar[int] @@ -41,7 +41,7 @@ ldap_pbkdf2_sha1: PrefixWrapper ldap_pbkdf2_sha256: PrefixWrapper ldap_pbkdf2_sha512: PrefixWrapper -class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): +class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any ident: Any @@ -56,7 +56,7 @@ class cta_pbkdf2_sha1(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.Generic def from_string(cls, hash): ... def to_string(self): ... -class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class dlitz_pbkdf2_sha1(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any ident: Any @@ -82,7 +82,7 @@ class atlassian_pbkdf2_sha1(uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler) def from_string(cls, hash): ... def to_string(self): ... -class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): +class grub_pbkdf2_sha512(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/phpass.pyi b/stubs/passlib/passlib/handlers/phpass.pyi index 154e34e4812c..95120e2ba1af 100644 --- a/stubs/passlib/passlib/handlers/phpass.pyi +++ b/stubs/passlib/passlib/handlers/phpass.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class phpass(uh.HasManyIdents, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_chars: Any diff --git a/stubs/passlib/passlib/handlers/scram.pyi b/stubs/passlib/passlib/handlers/scram.pyi index 15c4e2d371e6..3720651890c3 100644 --- a/stubs/passlib/passlib/handlers/scram.pyi +++ b/stubs/passlib/passlib/handlers/scram.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): +class scram(uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/scrypt.pyi b/stubs/passlib/passlib/handlers/scrypt.pyi index 5258f7c890b3..341dbaeaa4f5 100644 --- a/stubs/passlib/passlib/handlers/scrypt.pyi +++ b/stubs/passlib/passlib/handlers/scrypt.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.HasManyIdents, uh.GenericHandler): +class scrypt(uh.ParallelismMixin, uh.HasRounds, uh.HasRawSalt, uh.HasRawChecksum, uh.HasManyIdents, uh.GenericHandler): # type: ignore[misc] backends: ClassVar[tuple[str, ...]] name: str setting_kwds: Any diff --git a/stubs/passlib/passlib/handlers/sha1_crypt.pyi b/stubs/passlib/passlib/handlers/sha1_crypt.pyi index c56c6683cbad..9167f7551eb9 100644 --- a/stubs/passlib/passlib/handlers/sha1_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha1_crypt.pyi @@ -4,7 +4,7 @@ import passlib.utils.handlers as uh log: Any -class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class sha1_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any ident: Any diff --git a/stubs/passlib/passlib/handlers/sha2_crypt.pyi b/stubs/passlib/passlib/handlers/sha2_crypt.pyi index 3fb8240a54bd..9ccae22351ce 100644 --- a/stubs/passlib/passlib/handlers/sha2_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sha2_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any import passlib.utils.handlers as uh -class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class _SHA2_Common(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] setting_kwds: Any checksum_chars: Any max_salt_size: int diff --git a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi index 5d25e418ed41..82f161b5c133 100644 --- a/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi +++ b/stubs/passlib/passlib/handlers/sun_md5_crypt.pyi @@ -2,7 +2,7 @@ from typing import Any, ClassVar import passlib.utils.handlers as uh -class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): +class sun_md5_crypt(uh.HasRounds, uh.HasSalt, uh.GenericHandler): # type: ignore[misc] name: str setting_kwds: Any checksum_chars: Any diff --git a/stubs/polib/polib.pyi b/stubs/polib/polib.pyi index 2e3e0bee6751..932b8282ad8e 100644 --- a/stubs/polib/polib.pyi +++ b/stubs/polib/polib.pyi @@ -33,7 +33,7 @@ class _BaseFile(list[_TB]): metadata_is_fuzzy: bool def __init__(self, *args: Any, **kwargs: Any) -> None: ... def __unicode__(self) -> Text: ... - def __contains__(self, entry: _TB) -> bool: ... # AttributeError otherwise + def __contains__(self, entry: _TB) -> bool: ... # type: ignore[override] # AttributeError otherwise def __eq__(self, other: object) -> bool: ... def append(self, entry: _TB) -> None: ... def insert(self, index: SupportsIndex, entry: _TB) -> None: ... @@ -60,7 +60,7 @@ class MOFile(_BaseFile[MOEntry]): version: int def __init__(self, *args: Any, **kwargs: Any) -> None: ... def save_as_pofile(self, fpath: str) -> None: ... - def save(self, fpath: Text | None = ...) -> None: ... # binary file does not allow argument repr_method + def save(self, fpath: Text | None = ...) -> None: ... # type: ignore[override] # binary file does not allow argument repr_method def percent_translated(self) -> int: ... def translated_entries(self) -> list[MOEntry]: ... def untranslated_entries(self) -> list[MOEntry]: ... From f10898b802492e1c819d3abbbc9de75bf876f677 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 17 Mar 2022 09:50:57 +0000 Subject: [PATCH 3/8] Add some `type: ignore`s back for pyright --- stdlib/builtins.pyi | 2 +- stdlib/enum.pyi | 6 +++--- stdlib/importlib/metadata/__init__.pyi | 2 +- stdlib/typing.pyi | 2 +- stdlib/weakref.pyi | 2 +- stubs/filelock/filelock/__init__.pyi | 2 +- stubs/mypy-extensions/mypy_extensions.pyi | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index fc4adb5307ef..c668ca40e976 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -88,7 +88,7 @@ class object: def __class__(self: Self) -> type[Self]: ... # Ignore errors about type mismatch between property getter and setter @__class__.setter - def __class__(self, __type: type[object]) -> None: ... # noqa: F811 + def __class__(self, __type: type[object]) -> None: ... # type: ignore # noqa: F811 def __init__(self) -> None: ... def __new__(cls: type[Self]) -> Self: ... # N.B. `object.__setattr__` and `object.__delattr__` are heavily special-cased by type checkers. diff --git a/stdlib/enum.pyi b/stdlib/enum.pyi index e88f1f1d45e5..a7075e030429 100644 --- a/stdlib/enum.pyi +++ b/stdlib/enum.pyi @@ -66,7 +66,7 @@ class _EnumDict(dict[str, Any]): class EnumMeta(ABCMeta): if sys.version_info >= (3, 11): def __new__( - metacls: type[Self], + metacls: type[Self], # type: ignore cls: str, bases: tuple[type, ...], classdict: _EnumDict, @@ -76,9 +76,9 @@ class EnumMeta(ABCMeta): **kwds: Any, ) -> Self: ... elif sys.version_info >= (3, 9): - def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... + def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict, **kwds: Any) -> Self: ... # type: ignore else: - def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... + def __new__(metacls: type[Self], cls: str, bases: tuple[type, ...], classdict: _EnumDict) -> Self: ... # type: ignore if sys.version_info >= (3, 9): @classmethod diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index a4fef9534ce8..52c5547a6128 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -182,7 +182,7 @@ class MetadataPathFinder(DistributionFinder): def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ... if sys.version_info >= (3, 10): # Yes, this is an instance method that has argumend named "cls" - def invalidate_caches(cls) -> None: ... + def invalidate_caches(cls) -> None: ... # type: ignore class PathDistribution(Distribution): def __init__(self, path: Path) -> None: ... diff --git a/stdlib/typing.pyi b/stdlib/typing.pyi index 469561c9dfc1..457ad21b72d2 100644 --- a/stdlib/typing.pyi +++ b/stdlib/typing.pyi @@ -1207,7 +1207,7 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta): # 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: ... + def pop(self, k: NoReturn, default: _T = ...) -> object: ... # type: ignore def update(self: _T, __m: _T) -> None: ... def __delitem__(self, k: NoReturn) -> None: ... def items(self) -> ItemsView[str, object]: ... diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 2a2e6da2ccec..820488529143 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -87,7 +87,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: type[Self], ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... + def __new__(type: type[Self], ob: _T, callback: Callable[[_T], Any], key: _KT) -> Self: ... # type: ignore def __init__(self, ob: _T, callback: Callable[[_T], Any], key: _KT) -> None: ... class WeakKeyDictionary(MutableMapping[_KT, _VT]): diff --git a/stubs/filelock/filelock/__init__.pyi b/stubs/filelock/filelock/__init__.pyi index f2595727e013..1d66887f130a 100644 --- a/stubs/filelock/filelock/__init__.pyi +++ b/stubs/filelock/filelock/__init__.pyi @@ -19,7 +19,7 @@ class BaseFileLock: @property def timeout(self) -> float: ... @timeout.setter - def timeout(self, value: int | str | float) -> None: ... + def timeout(self, value: int | str | float) -> None: ... # type: ignore @property def is_locked(self) -> bool: ... def acquire(self, timeout: float | None = ..., poll_intervall: float = ...) -> _Acquire_ReturnProxy: ... diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index dad47efe82f4..33b47244d385 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -13,7 +13,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): # 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: ... + def pop(self, k: NoReturn, default: _T = ...) -> object: ... # type: ignore def update(self: Self, __m: Self) -> None: ... if sys.version_info >= (3, 0): def items(self) -> ItemsView[str, object]: ... From e09fe45a43ec5d0a7171654bd372e046e8c2b465 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 17 Mar 2022 10:05:46 +0000 Subject: [PATCH 4/8] Remove many no-longer-needed explanatory comments --- stdlib/http/client.pyi | 2 +- stdlib/importlib/machinery.pyi | 4 ++-- stdlib/io.pyi | 10 +++++----- stdlib/unittest/mock.pyi | 2 +- .../sqlalchemy/dialects/mysql/enumerated.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi | 2 +- .../SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/orm/context.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi | 2 +- stubs/babel/babel/support.pyi | 2 +- stubs/beautifulsoup4/bs4/builder/_lxml.pyi | 2 +- stubs/boto/boto/auth.pyi | 2 +- stubs/mock/mock/mock.pyi | 2 +- stubs/openpyxl/openpyxl/chart/bar_chart.pyi | 2 +- stubs/openpyxl/openpyxl/chart/surface_chart.pyi | 2 +- 17 files changed, 22 insertions(+), 22 deletions(-) diff --git a/stdlib/http/client.pyi b/stdlib/http/client.pyi index afb1ad16c835..801a195c9fb3 100644 --- a/stdlib/http/client.pyi +++ b/stdlib/http/client.pyi @@ -100,7 +100,7 @@ class HTTPMessage(email.message.Message): def parse_headers(fp: io.BufferedIOBase, _class: Callable[[], email.message.Message] = ...) -> HTTPMessage: ... -class HTTPResponse(io.BufferedIOBase, BinaryIO): # argument disparities between base classes +class HTTPResponse(io.BufferedIOBase, BinaryIO): msg: HTTPMessage headers: HTTPMessage version: int diff --git a/stdlib/importlib/machinery.pyi b/stdlib/importlib/machinery.pyi index c0f423bc62f9..f15ac48af5c5 100644 --- a/stdlib/importlib/machinery.pyi +++ b/stdlib/importlib/machinery.pyi @@ -133,10 +133,10 @@ class FileFinder(importlib.abc.PathEntryFinder): cls, *loader_details: tuple[type[importlib.abc.Loader], list[str]] ) -> Callable[[str], importlib.abc.PathEntryFinder]: ... -class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): # argument disparities +class SourceFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): def set_data(self, path: importlib.abc._Path, data: bytes, *, _mode: int = ...) -> None: ... -class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... # argument disparities +class SourcelessFileLoader(importlib.abc.FileLoader, importlib.abc.SourceLoader): ... class ExtensionFileLoader(importlib.abc.ExecutionLoader): def __init__(self, name: str, path: importlib.abc._Path) -> None: ... diff --git a/stdlib/io.pyi b/stdlib/io.pyi index 09b20282a5e6..ef4789251cc3 100644 --- a/stdlib/io.pyi +++ b/stdlib/io.pyi @@ -108,7 +108,7 @@ class BufferedIOBase(IOBase): def read(self, __size: int | None = ...) -> bytes: ... def read1(self, __size: int = ...) -> bytes: ... -class FileIO(RawIOBase, BinaryIO): # argument disparities between the base classes +class FileIO(RawIOBase, BinaryIO): mode: str name: StrOrBytesPath | int # type: ignore[assignment] def __init__( @@ -120,7 +120,7 @@ class FileIO(RawIOBase, BinaryIO): # argument disparities between the base clas def read(self, __size: int = ...) -> bytes: ... def __enter__(self: Self) -> Self: ... -class BytesIO(BufferedIOBase, BinaryIO): # argument disparities between the base classes +class BytesIO(BufferedIOBase, BinaryIO): def __init__(self, initial_bytes: bytes = ...) -> None: ... # BytesIO does not contain a "name" field. This workaround is necessary # to allow BytesIO sub-classes to add this field, as it is defined @@ -134,7 +134,7 @@ class BytesIO(BufferedIOBase, BinaryIO): # argument disparities between the bas else: def read1(self, __size: int | None) -> bytes: ... # type: ignore[override] -class BufferedReader(BufferedIOBase, BinaryIO): # argument disparities between base classes +class BufferedReader(BufferedIOBase, BinaryIO): def __enter__(self: Self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def peek(self, __size: int = ...) -> bytes: ... @@ -143,7 +143,7 @@ class BufferedReader(BufferedIOBase, BinaryIO): # argument disparities between else: def read1(self, __size: int) -> bytes: ... # type: ignore[override] -class BufferedWriter(BufferedIOBase, BinaryIO): # argument disparities between base classes +class BufferedWriter(BufferedIOBase, BinaryIO): def __enter__(self: Self) -> Self: ... def __init__(self, raw: RawIOBase, buffer_size: int = ...) -> None: ... def write(self, __buffer: ReadableBuffer) -> int: ... @@ -175,7 +175,7 @@ class TextIOBase(IOBase): def read(self, __size: int | None = ...) -> str: ... def tell(self) -> int: ... -class TextIOWrapper(TextIOBase, TextIO): # argument disparities between base classes +class TextIOWrapper(TextIOBase, TextIO): def __init__( self, buffer: IO[bytes], diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 0dfc7c7d7674..1f7ac9d5bd8c 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -432,7 +432,7 @@ if sys.version_info >= (3, 8): class AsyncMagicMixin(MagicMixin): def __init__(self, *args: Any, **kw: Any) -> None: ... - class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # argument disparities between base classes + class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... class MagicProxy: name: str diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi index f0ea3f5d8497..fc3283c0d70c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi @@ -3,7 +3,7 @@ from typing import Any from ...sql import sqltypes from .types import _StringType -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): # incompatible with base class +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): __visit_name__: str native_enum: bool def __init__(self, *enums, **kw) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index 11ea52bcb9e1..bbaf6918185f 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -32,7 +32,7 @@ class _StringType(sqltypes.String): **kw, ) -> None: ... -class _MatchType(sqltypes.Float, sqltypes.MatchType): # incompatible with base class +class _MatchType(sqltypes.Float, sqltypes.MatchType): def __init__(self, **kw) -> None: ... class NUMERIC(_NumericType, sqltypes.NUMERIC): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index a7ef9507d162..6559915b19f8 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -96,7 +96,7 @@ PGUuid = UUID class TSVECTOR(sqltypes.TypeEngine): __visit_name__: str -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # base classes incompatible +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): native_enum: bool create_type: Any def __init__(self, *enums, **kw) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi index 28e31f3bf525..3940f1f665e3 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/sybase/pyodbc.pyi @@ -10,7 +10,7 @@ class _SybNumeric_pyodbc(sqltypes.Numeric): class SybaseExecutionContext_pyodbc(SybaseExecutionContext): def set_ddl_autocommit(self, connection, value) -> None: ... -class SybaseDialect_pyodbc(PyODBCConnector, SybaseDialect): # argument disparities between base classes +class SybaseDialect_pyodbc(PyODBCConnector, SybaseDialect): supports_statement_cache: bool colspecs: Any @classmethod diff --git a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi index 2298b688dea9..bc123f007e77 100644 --- a/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/orm/context.pyi @@ -75,7 +75,7 @@ class ORMFromStatementCompileState(ORMCompileState): @classmethod def create_for_statement(cls, statement_container, compiler, **kw): ... -class ORMSelectCompileState(ORMCompileState, SelectState): # argument disparities between base classes +class ORMSelectCompileState(ORMCompileState, SelectState): multi_row_eager_loaders: bool compound_eager_adapter: Any correlate: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi index 9cdd4f56a0ea..66b4197d64f2 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/schema.pyi @@ -37,7 +37,7 @@ class Table(DialectKWArgs, SchemaItem, TableClause): def tometadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... def to_metadata(self, metadata, schema=..., referred_schema_fn: Any | None = ..., name: Any | None = ...): ... -class Column(DialectKWArgs, SchemaItem, ColumnClause): # argument disparities between base classes +class Column(DialectKWArgs, SchemaItem, ColumnClause): __visit_name__: str inherit_cache: bool key: Any diff --git a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi index 471d845d6aea..fc90e0d7fadd 100644 --- a/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi @@ -155,7 +155,7 @@ class SchemaType(SchemaEventTarget): def create(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... def drop(self, bind: Any | None = ..., checkfirst: bool = ...) -> None: ... -class Enum(Emulated, String, SchemaType): # argument disparities between base classes +class Enum(Emulated, String, SchemaType): __visit_name__: str def __init__(self, *enums, **kw) -> None: ... @property diff --git a/stubs/babel/babel/support.pyi b/stubs/babel/babel/support.pyi index 0ff221823e11..658eb14d7e73 100644 --- a/stubs/babel/babel/support.pyi +++ b/stubs/babel/babel/support.pyi @@ -79,7 +79,7 @@ class NullTranslations(gettext.NullTranslations): ugettext: Any ungettext: Any -class Translations(NullTranslations, gettext.GNUTranslations): # argument disparities between base classes +class Translations(NullTranslations, gettext.GNUTranslations): DEFAULT_DOMAIN: str domain: Any def __init__(self, fp: Any | None = ..., domain: Any | None = ...) -> None: ... diff --git a/stubs/beautifulsoup4/bs4/builder/_lxml.pyi b/stubs/beautifulsoup4/bs4/builder/_lxml.pyi index 3c9b8694eafb..b206067cddb5 100644 --- a/stubs/beautifulsoup4/bs4/builder/_lxml.pyi +++ b/stubs/beautifulsoup4/bs4/builder/_lxml.pyi @@ -37,7 +37,7 @@ class LXMLTreeBuilderForXML(TreeBuilder): def comment(self, content) -> None: ... def test_fragment_to_document(self, fragment): ... -class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML): # argument disparities between base classes +class LXMLTreeBuilder(HTMLTreeBuilder, LXMLTreeBuilderForXML): NAME: Any ALTERNATE_NAMES: Any features: Any diff --git a/stubs/boto/boto/auth.pyi b/stubs/boto/boto/auth.pyi index cf44d1848a10..2dc77949c110 100644 --- a/stubs/boto/boto/auth.pyi +++ b/stubs/boto/boto/auth.pyi @@ -64,7 +64,7 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys): def signature(self, http_request, string_to_sign): ... def add_auth(self, req, **kwargs): ... -class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): # argument disparities between base classes +class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): capability: Any region_name: Any def __init__(self, *args, **kwargs) -> None: ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 21dc0fae6781..4dc2682487e0 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -275,7 +275,7 @@ class AsyncMockMixin(Base): class AsyncMagicMixin(MagicMixin): def __init__(self, *args: Any, **kw: Any) -> None: ... -class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... # argument disparities between base classes +class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock): ... class MagicProxy(Base): name: str diff --git a/stubs/openpyxl/openpyxl/chart/bar_chart.pyi b/stubs/openpyxl/openpyxl/chart/bar_chart.pyi index 5f4fd333eb54..d48fc86ef303 100644 --- a/stubs/openpyxl/openpyxl/chart/bar_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/bar_chart.pyi @@ -39,7 +39,7 @@ class BarChart(_BarChartBase): self, gapWidth: int = ..., overlap: Any | None = ..., serLines: Any | None = ..., extLst: Any | None = ..., **kw ) -> None: ... -class BarChart3D(_BarChartBase, _3DBase): # incompatible base classes +class BarChart3D(_BarChartBase, _3DBase): tagname: str barDir: Any grouping: Any diff --git a/stubs/openpyxl/openpyxl/chart/surface_chart.pyi b/stubs/openpyxl/openpyxl/chart/surface_chart.pyi index ebdda31d390d..15d52a855170 100644 --- a/stubs/openpyxl/openpyxl/chart/surface_chart.pyi +++ b/stubs/openpyxl/openpyxl/chart/surface_chart.pyi @@ -30,7 +30,7 @@ class _SurfaceChartBase(ChartBase): @abstractmethod def tagname(self) -> str: ... -class SurfaceChart3D(_SurfaceChartBase, _3DBase): # incompatible base classes +class SurfaceChart3D(_SurfaceChartBase, _3DBase): tagname: str wireframe: Any ser: Any From 731acd3c1ece49b61f14c87a6b28863fd1c86f5a Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 17 Mar 2022 10:09:55 +0000 Subject: [PATCH 5/8] Add one more `type: ignore` back for pyright --- stdlib/typing_extensions.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/typing_extensions.pyi b/stdlib/typing_extensions.pyi index 2300c15f7b8d..193fa4feb4f3 100644 --- a/stdlib/typing_extensions.pyi +++ b/stdlib/typing_extensions.pyi @@ -70,7 +70,7 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): # 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: ... + def pop(self, k: NoReturn, default: _T = ...) -> object: ... # type: ignore def update(self: _T, __m: _T) -> None: ... def items(self) -> ItemsView[str, object]: ... def keys(self) -> KeysView[str]: ... From 5c898d7cd73ce5baf51a4ad5ff917684f24e0229 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 17 Mar 2022 10:15:11 +0000 Subject: [PATCH 6/8] More ignores for pyright --- stubs/passlib/passlib/handlers/argon2.pyi | 2 +- stubs/passlib/passlib/totp.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/passlib/passlib/handlers/argon2.pyi b/stubs/passlib/passlib/handlers/argon2.pyi index afa23cc56d3a..b947a3901c84 100644 --- a/stubs/passlib/passlib/handlers/argon2.pyi +++ b/stubs/passlib/passlib/handlers/argon2.pyi @@ -28,7 +28,7 @@ class _Argon2Common( # type: ignore[misc] min_memory_cost: int max_threads: int pure_use_threads: bool - def type_values(cls): ... + def type_values(cls): ... # type: ignore type: Any parallelism: Any version: Any diff --git a/stubs/passlib/passlib/totp.pyi b/stubs/passlib/passlib/totp.pyi index 0f9160282f95..f44e3e383904 100644 --- a/stubs/passlib/passlib/totp.pyi +++ b/stubs/passlib/passlib/totp.pyi @@ -78,7 +78,7 @@ class TOTP: def pretty_key(self, format: str = ..., sep: str = ...): ... @classmethod def normalize_time(cls, time): ... - def normalize_token(self_or_cls, token): ... + def normalize_token(self_or_cls, token): ... # type: ignore def generate(self, time: Any | None = ...): ... @classmethod def verify(cls, token, source, **kwds): ... From 542436b4b7ae6d21149363c2b45897316a93b69c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 17 Mar 2022 10:20:23 +0000 Subject: [PATCH 7/8] Add some ignores for stubtest --- stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi | 2 +- stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi index fc3283c0d70c..e68dcdfdf032 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/enumerated.pyi @@ -3,7 +3,7 @@ from typing import Any from ...sql import sqltypes from .types import _StringType -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum, _StringType): # type: ignore # incompatible with base class __visit_name__: str native_enum: bool def __init__(self, *enums, **kw) -> None: ... diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi index bbaf6918185f..fecd364f683c 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/mysql/types.pyi @@ -32,7 +32,7 @@ class _StringType(sqltypes.String): **kw, ) -> None: ... -class _MatchType(sqltypes.Float, sqltypes.MatchType): +class _MatchType(sqltypes.Float, sqltypes.MatchType): # type: ignore # incompatible with base class def __init__(self, **kw) -> None: ... class NUMERIC(_NumericType, sqltypes.NUMERIC): diff --git a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi index 6559915b19f8..a2b167315ae9 100644 --- a/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/base.pyi @@ -96,7 +96,7 @@ PGUuid = UUID class TSVECTOR(sqltypes.TypeEngine): __visit_name__: str -class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): +class ENUM(sqltypes.NativeForEmulated, sqltypes.Enum): # type: ignore # base classes incompatible native_enum: bool create_type: Any def __init__(self, *enums, **kw) -> None: ... From 86bee7696bc4f9d3542ac992ef4f09e2976ae64e Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 19 Mar 2022 08:08:21 +0000 Subject: [PATCH 8/8] Delete more newly redundant comments Co-authored-by: Jelle Zijlstra --- stdlib/@python2/smtpd.pyi | 1 - stdlib/@python2/typing_extensions.pyi | 1 - stubs/boto/boto/connection.pyi | 2 +- stubs/boto/boto/s3/connection.pyi | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stdlib/@python2/smtpd.pyi b/stdlib/@python2/smtpd.pyi index 6fc8b52f4b47..c7741d183415 100644 --- a/stdlib/@python2/smtpd.pyi +++ b/stdlib/@python2/smtpd.pyi @@ -9,7 +9,6 @@ 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: ... def collect_incoming_data(self, data: bytes) -> None: ... def found_terminator(self) -> None: ... diff --git a/stdlib/@python2/typing_extensions.pyi b/stdlib/@python2/typing_extensions.pyi index 502cd709dc78..1f5123d32a04 100644 --- a/stdlib/@python2/typing_extensions.pyi +++ b/stdlib/@python2/typing_extensions.pyi @@ -47,7 +47,6 @@ 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: ... def update(self: _T, __m: _T) -> None: ... def has_key(self, k: str) -> bool: ... diff --git a/stubs/boto/boto/connection.pyi b/stubs/boto/boto/connection.pyi index 3cbecf879f75..fe2f136de717 100644 --- a/stubs/boto/boto/connection.pyi +++ b/stubs/boto/boto/connection.pyi @@ -168,7 +168,7 @@ class AWSQueryConnection(AWSAuthConnection): def get_utf8_value(self, value): ... def make_request( # type: ignore[override] self, action, params: Any | None = ..., path: str = ..., verb: str = ..., *args, **kwargs - ): ... # https://github.com/python/mypy/issues/1237 + ): ... def build_list_params(self, params, items, label): ... def build_complex_list_params(self, params, items, label, names): ... def get_list(self, action, params, markers, path: str = ..., parent: Any | None = ..., verb: str = ...): ... diff --git a/stubs/boto/boto/s3/connection.pyi b/stubs/boto/boto/s3/connection.pyi index d9a612540fb3..286b1c7fd5ff 100644 --- a/stubs/boto/boto/s3/connection.pyi +++ b/stubs/boto/boto/s3/connection.pyi @@ -136,4 +136,4 @@ class S3Connection(AWSAuthConnection): retry_handler: Any | None = ..., *args, **kwargs, - ): ... # https://github.com/python/mypy/issues/1237 + ): ...