diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index 2c09a11d949f..2062b58e0869 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -51,8 +51,6 @@ jobs: check-latest: true - name: Install dependencies run: pip install -r requirements-tests.txt - - name: Install mypy from git - run: pip install git+https://github.com/python/mypy@e8a26308d5d06925cf769b62f41ef2e4bc546ada - name: Run stubtest run: python tests/stubtest_stdlib.py diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml index c094f8c0f7b2..795eef7e793d 100644 --- a/.github/workflows/stubtest_stdlib.yml +++ b/.github/workflows/stubtest_stdlib.yml @@ -47,7 +47,5 @@ jobs: check-latest: true - name: Install dependencies run: pip install -r requirements-tests.txt - - name: Install mypy from git - run: pip install git+https://github.com/python/mypy@e8a26308d5d06925cf769b62f41ef2e4bc546ada - name: Run stubtest run: python tests/stubtest_stdlib.py diff --git a/requirements-tests.txt b/requirements-tests.txt index cfe5a3c274b9..3a16df66e730 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -5,7 +5,7 @@ black==24.4.2 # must match .pre-commit-config.yaml flake8==7.1.0 # must match .pre-commit-config.yaml flake8-noqa==1.4.0 # must match .pre-commit-config.yaml flake8-pyi==24.6.0 # must match .pre-commit-config.yaml -mypy==1.10.1 +mypy==1.11.1 pre-commit-hooks==4.6.0 # must match .pre-commit-config.yaml pyright==1.1.374 pytype==2024.4.11; platform_system != "Windows" and python_version < "3.12" diff --git a/stdlib/@tests/test_cases/check_enum.py b/stdlib/@tests/test_cases/check_enum.py index 4ea4947c811d..6de68a560263 100644 --- a/stdlib/@tests/test_cases/check_enum.py +++ b/stdlib/@tests/test_cases/check_enum.py @@ -7,8 +7,8 @@ A = enum.Enum("A", "spam eggs bacon") B = enum.Enum("B", ["spam", "eggs", "bacon"]) -C = enum.Enum("Bar", [("spam", 1), ("eggs", 2), ("bacon", 3)]) -D = enum.Enum("Bar", {"spam": 1, "eggs": 2}) +C = enum.Enum("C", [("spam", 1), ("eggs", 2), ("bacon", 3)]) +D = enum.Enum("D", {"spam": 1, "eggs": 2}) assert_type(A, Type[A]) assert_type(B, Type[B]) diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index f23ecef126d6..bb423e857399 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -151,13 +151,13 @@ if sys.version_info >= (3, 10): @overload def gather(*coros_or_futures: _FutureLike[_T], return_exceptions: Literal[False] = False) -> Future[list[_T]]: ... # type: ignore[overload-overlap] @overload - def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... # type: ignore[overload-overlap] + def gather(coro_or_future1: _FutureLike[_T1], /, *, return_exceptions: bool) -> Future[tuple[_T1 | BaseException]]: ... @overload - def gather( # type: ignore[overload-overlap] + def gather( coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], /, *, return_exceptions: bool ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ... @overload - def gather( # type: ignore[overload-overlap] + def gather( coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], coro_or_future3: _FutureLike[_T3], @@ -166,7 +166,7 @@ if sys.version_info >= (3, 10): return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ... @overload - def gather( # type: ignore[overload-overlap] + def gather( coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], coro_or_future3: _FutureLike[_T3], @@ -176,7 +176,7 @@ if sys.version_info >= (3, 10): return_exceptions: bool, ) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ... @overload - def gather( # type: ignore[overload-overlap] + def gather( coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], coro_or_future3: _FutureLike[_T3], @@ -189,7 +189,7 @@ if sys.version_info >= (3, 10): tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException] ]: ... @overload - def gather( # type: ignore[overload-overlap] + def gather( coro_or_future1: _FutureLike[_T1], coro_or_future2: _FutureLike[_T2], coro_or_future3: _FutureLike[_T3], diff --git a/stdlib/asyncio/unix_events.pyi b/stdlib/asyncio/unix_events.pyi index 5dd3831f9a0a..fb21c5b5fa05 100644 --- a/stdlib/asyncio/unix_events.pyi +++ b/stdlib/asyncio/unix_events.pyi @@ -159,7 +159,7 @@ if sys.platform != "win32": class _UnixSelectorEventLoop(BaseSelectorEventLoop): if sys.version_info >= (3, 13): - async def create_unix_server( # type: ignore[override] + async def create_unix_server( self, protocol_factory: _ProtocolFactory, path: StrPath | None = None, diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index bd9e759e90fb..dc821de1d30b 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1744,7 +1744,7 @@ _SupportsSumNoDefaultT = TypeVar("_SupportsSumNoDefaultT", bound=_SupportsSumWit # without creating many false-positive errors (see #7578). # Instead, we special-case the most common examples of this: bool and literal integers. @overload -def sum(iterable: Iterable[bool | _LiteralInteger], /, start: int = 0) -> int: ... # type: ignore[overload-overlap] +def sum(iterable: Iterable[bool | _LiteralInteger], /, start: int = 0) -> int: ... @overload def sum(iterable: Iterable[_SupportsSumNoDefaultT], /) -> _SupportsSumNoDefaultT | Literal[0]: ... @overload @@ -1752,9 +1752,8 @@ def sum(iterable: Iterable[_AddableT1], /, start: _AddableT2) -> _AddableT1 | _A # The argument to `vars()` has to have a `__dict__` attribute, so the second overload can't be annotated with `object` # (A "SupportsDunderDict" protocol doesn't work) -# Use a type: ignore to make complaints about overlapping overloads go away @overload -def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... # type: ignore[overload-overlap] +def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... @overload def vars(object: Any = ..., /) -> dict[str, Any]: ... diff --git a/stdlib/importlib/metadata/__init__.pyi b/stdlib/importlib/metadata/__init__.pyi index 37b9a3882179..5e26f8987277 100644 --- a/stdlib/importlib/metadata/__init__.pyi +++ b/stdlib/importlib/metadata/__init__.pyi @@ -155,7 +155,7 @@ if sys.version_info >= (3, 10) and sys.version_info < (3, 12): @property def names(self) -> set[str]: ... @overload - def select(self) -> Self: ... # type: ignore[misc] + def select(self) -> Self: ... @overload def select( self, @@ -277,7 +277,7 @@ if sys.version_info >= (3, 12): elif sys.version_info >= (3, 10): @overload - def entry_points() -> SelectableGroups: ... # type: ignore[overload-overlap] + def entry_points() -> SelectableGroups: ... @overload def entry_points( *, name: str = ..., value: str = ..., group: str = ..., module: str = ..., attr: str = ..., extras: list[str] = ... diff --git a/stdlib/lib2to3/fixes/fix_unicode.pyi b/stdlib/lib2to3/fixes/fix_unicode.pyi index 80d9d8b6e656..85d1315213b9 100644 --- a/stdlib/lib2to3/fixes/fix_unicode.pyi +++ b/stdlib/lib2to3/fixes/fix_unicode.pyi @@ -6,7 +6,7 @@ from ..pytree import Node class FixUnicode(fixer_base.BaseFix): BM_compatible: ClassVar[Literal[True]] - PATTERN: ClassVar[Literal["STRING | 'unicode' | 'unichr'"]] # type: ignore[name-defined] # Name "STRING" is not defined + PATTERN: ClassVar[str] unicode_literals: bool def start_tree(self, tree: Node, filename: StrPath) -> None: ... def transform(self, node, results): ... diff --git a/stdlib/multiprocessing/sharedctypes.pyi b/stdlib/multiprocessing/sharedctypes.pyi index 2b96ff047470..2b0498abc2c6 100644 --- a/stdlib/multiprocessing/sharedctypes.pyi +++ b/stdlib/multiprocessing/sharedctypes.pyi @@ -73,7 +73,7 @@ def copy(obj: _CT) -> _CT: ... @overload def synchronized(obj: _SimpleCData[_T], lock: _LockLike | None = None, ctx: Any | None = None) -> Synchronized[_T]: ... @overload -def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... # type: ignore +def synchronized(obj: ctypes.Array[c_char], lock: _LockLike | None = None, ctx: Any | None = None) -> SynchronizedString: ... @overload def synchronized( obj: ctypes.Array[_SimpleCData[_T]], lock: _LockLike | None = None, ctx: Any | None = None @@ -115,12 +115,12 @@ class SynchronizedArray(SynchronizedBase[ctypes.Array[_SimpleCData[_T]]], Generi class SynchronizedString(SynchronizedArray[bytes]): @overload # type: ignore[override] def __getitem__(self, i: slice) -> bytes: ... - @overload # type: ignore[override] + @overload def __getitem__(self, i: int) -> bytes: ... @overload # type: ignore[override] def __setitem__(self, i: slice, value: bytes) -> None: ... - @overload # type: ignore[override] - def __setitem__(self, i: int, value: bytes) -> None: ... # type: ignore[override] + @overload + def __setitem__(self, i: int, value: bytes) -> None: ... def __getslice__(self, start: int, stop: int) -> bytes: ... # type: ignore[override] def __setslice__(self, start: int, stop: int, values: bytes) -> None: ... # type: ignore[override] diff --git a/stdlib/pdb.pyi b/stdlib/pdb.pyi index d49315427813..61e8b7176e84 100644 --- a/stdlib/pdb.pyi +++ b/stdlib/pdb.pyi @@ -84,7 +84,7 @@ class Pdb(Bdb, Cmd): def _runscript(self, filename: str) -> None: ... if sys.version_info >= (3, 13): - def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... # type: ignore[override] + def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ... def do_commands(self, arg: str) -> bool | None: ... def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ... diff --git a/stdlib/re.pyi b/stdlib/re.pyi index b06f494c0b7d..76f98dd9f2a2 100644 --- a/stdlib/re.pyi +++ b/stdlib/re.pyi @@ -74,7 +74,7 @@ class Match(Generic[AnyStr]): @overload def expand(self: Match[str], template: str) -> str: ... @overload - def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... # type: ignore[overload-overlap] + def expand(self: Match[bytes], template: ReadableBuffer) -> bytes: ... @overload def expand(self, template: AnyStr) -> AnyStr: ... # group() returns "AnyStr" or "AnyStr | None", depending on the pattern. @@ -124,19 +124,21 @@ class Pattern(Generic[AnyStr]): @overload def search(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[overload-overlap] + def search(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... @overload def search(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload def match(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[overload-overlap] + def match(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... @overload def match(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload def fullmatch(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Match[str] | None: ... @overload - def fullmatch(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Match[bytes] | None: ... # type: ignore[overload-overlap] + def fullmatch( + self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize + ) -> Match[bytes] | None: ... @overload def fullmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... @overload @@ -155,13 +157,15 @@ class Pattern(Generic[AnyStr]): @overload def finditer(self: Pattern[str], string: str, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[str]]: ... @overload - def finditer(self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[bytes]]: ... # type: ignore[overload-overlap] + def finditer( + self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize + ) -> Iterator[Match[bytes]]: ... @overload def finditer(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Iterator[Match[AnyStr]]: ... @overload def sub(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> str: ... @overload - def sub( # type: ignore[overload-overlap] + def sub( self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, @@ -172,7 +176,7 @@ class Pattern(Generic[AnyStr]): @overload def subn(self: Pattern[str], repl: str | Callable[[Match[str]], str], string: str, count: int = 0) -> tuple[str, int]: ... @overload - def subn( # type: ignore[overload-overlap] + def subn( self: Pattern[bytes], repl: ReadableBuffer | Callable[[Match[bytes]], ReadableBuffer], string: ReadableBuffer, diff --git a/stdlib/tempfile.pyi b/stdlib/tempfile.pyi index d31fd74d3482..62422b84eb37 100644 --- a/stdlib/tempfile.pyi +++ b/stdlib/tempfile.pyi @@ -463,7 +463,7 @@ class TemporaryDirectory(Generic[AnyStr]): # The overloads overlap, but they should still work fine. @overload -def mkstemp( # type: ignore[overload-overlap] +def mkstemp( suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None, text: bool = False ) -> tuple[int, str]: ... @overload @@ -473,7 +473,7 @@ def mkstemp( # The overloads overlap, but they should still work fine. @overload -def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... # type: ignore[overload-overlap] +def mkdtemp(suffix: str | None = None, prefix: str | None = None, dir: StrPath | None = None) -> str: ... @overload def mkdtemp(suffix: bytes | None = None, prefix: bytes | None = None, dir: BytesPath | None = None) -> bytes: ... def mktemp(suffix: str = "", prefix: str = "tmp", dir: StrPath | None = None) -> str: ... diff --git a/stdlib/tkinter/__init__.pyi b/stdlib/tkinter/__init__.pyi index 77953525bebe..0931b43f1bee 100644 --- a/stdlib/tkinter/__init__.pyi +++ b/stdlib/tkinter/__init__.pyi @@ -3564,7 +3564,7 @@ class Spinbox(Widget, XView): def scan_dragto(self, x): ... def selection(self, *args) -> tuple[int, ...]: ... def selection_adjust(self, index): ... - def selection_clear(self): ... + def selection_clear(self): ... # type: ignore[override] def selection_element(self, element: Incomplete | None = None): ... def selection_from(self, index: int) -> None: ... def selection_present(self) -> None: ... diff --git a/stdlib/tkinter/ttk.pyi b/stdlib/tkinter/ttk.pyi index 86a23ce82211..b3d681c930f5 100644 --- a/stdlib/tkinter/ttk.pyi +++ b/stdlib/tkinter/ttk.pyi @@ -1040,7 +1040,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def heading(self, column: str | int, option: str) -> Any: ... @overload - def heading(self, column: str | int, option: None = None) -> _TreeviewHeaderDict: ... # type: ignore[overload-overlap] + def heading(self, column: str | int, option: None = None) -> _TreeviewHeaderDict: ... @overload def heading( self, @@ -1052,7 +1052,8 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): anchor: tkinter._Anchor = ..., command: str | Callable[[], object] = ..., ) -> None: ... - def identify(self, component, x, y): ... # Internal Method. Leave untyped + # Internal Method. Leave untyped: + def identify(self, component, x, y): ... # type: ignore[override] def identify_row(self, y: int) -> str: ... def identify_column(self, x: int) -> str: ... def identify_region(self, x: int, y: int) -> Literal["heading", "separator", "tree", "cell", "nothing"]: ... @@ -1084,7 +1085,7 @@ class Treeview(Widget, tkinter.XView, tkinter.YView): @overload def item(self, item: str | int, option: str) -> Any: ... @overload - def item(self, item: str | int, option: None = None) -> _TreeviewItemDict: ... # type: ignore[overload-overlap] + def item(self, item: str | int, option: None = None) -> _TreeviewItemDict: ... @overload def item( self, diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index 199feee746cb..29d289303927 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -338,7 +338,7 @@ class TPen: def isvisible(self) -> bool: ... # Note: signatures 1 and 2 overlap unsafely when no arguments are provided @overload - def pen(self) -> _PenState: ... # type: ignore[overload-overlap] + def pen(self) -> _PenState: ... @overload def pen( self, @@ -384,7 +384,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[overload-overlap] + def shapesize(self) -> tuple[float, float, float]: ... @overload def shapesize( self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None @@ -395,7 +395,7 @@ class RawTurtle(TPen, TNavigator): def shearfactor(self, shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @overload - def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[overload-overlap] + def shapetransform(self) -> tuple[float, float, float, float]: ... @overload def shapetransform( self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None @@ -622,7 +622,7 @@ def isvisible() -> bool: ... # Note: signatures 1 and 2 overlap unsafely when no arguments are provided @overload -def pen() -> _PenState: ... # type: ignore[overload-overlap] +def pen() -> _PenState: ... @overload def pen( pen: _PenState | None = None, @@ -661,7 +661,7 @@ if sys.version_info >= (3, 12): # Unsafely overlaps when no arguments are provided @overload -def shapesize() -> tuple[float, float, float]: ... # type: ignore[overload-overlap] +def shapesize() -> tuple[float, float, float]: ... @overload def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ... @overload @@ -671,7 +671,7 @@ def shearfactor(shear: float) -> None: ... # Unsafely overlaps when no arguments are provided @overload -def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[overload-overlap] +def shapetransform() -> tuple[float, float, float, float]: ... @overload def shapetransform( t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None diff --git a/stdlib/types.pyi b/stdlib/types.pyi index 1e3eacd9f1fa..0f6592a9883e 100644 --- a/stdlib/types.pyi +++ b/stdlib/types.pyi @@ -305,9 +305,9 @@ class MappingProxyType(Mapping[_KT, _VT_co]): def values(self) -> ValuesView[_VT_co]: ... def items(self) -> ItemsView[_KT, _VT_co]: ... @overload - def get(self, key: _KT, /) -> _VT_co | None: ... # type: ignore[override] + def get(self, key: _KT, /) -> _VT_co | None: ... @overload - def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ... # type: ignore[override] + def get(self, key: _KT, default: _VT_co | _T2, /) -> _VT_co | _T2: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... def __reversed__(self) -> Iterator[_KT]: ... @@ -583,7 +583,7 @@ _P = ParamSpec("_P") # it's not really an Awaitable, but can be used in an await expression. Real type: Generator & Awaitable @overload -def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Awaitable[_R]]: ... # type: ignore[overload-overlap] +def coroutine(func: Callable[_P, Generator[Any, Any, _R]]) -> Callable[_P, Awaitable[_R]]: ... @overload def coroutine(func: _Fn) -> _Fn: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 84620b7f3889..1cfd38f540a4 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -299,7 +299,7 @@ class _patcher: # Ideally we'd be able to add an overload for it so that the return type is _patch[MagicMock], # but that's impossible with the current type system. @overload - def __call__( # type: ignore[overload-overlap] + def __call__( self, target: str, new: _T, diff --git a/stdlib/urllib/parse.pyi b/stdlib/urllib/parse.pyi index 89a50995d553..785bb9678ec7 100644 --- a/stdlib/urllib/parse.pyi +++ b/stdlib/urllib/parse.pyi @@ -198,13 +198,13 @@ else: # Requires an iterable of length 6 @overload -def urlunparse(components: Iterable[None]) -> Literal[b""]: ... +def urlunparse(components: Iterable[None]) -> Literal[b""]: ... # type: ignore[overload-overlap] @overload def urlunparse(components: Iterable[AnyStr | None]) -> AnyStr: ... # Requires an iterable of length 5 @overload -def urlunsplit(components: Iterable[None]) -> Literal[b""]: ... +def urlunsplit(components: Iterable[None]) -> Literal[b""]: ... # type: ignore[overload-overlap] @overload def urlunsplit(components: Iterable[AnyStr | None]) -> AnyStr: ... def unwrap(url: str) -> str: ... diff --git a/stubs/ExifRead/exifread/utils.pyi b/stubs/ExifRead/exifread/utils.pyi index 77034f00e133..1dace202cbd2 100644 --- a/stubs/ExifRead/exifread/utils.pyi +++ b/stubs/ExifRead/exifread/utils.pyi @@ -6,7 +6,7 @@ from typing_extensions import Self _T = TypeVar("_T") @overload -def ord_(dta: str) -> int: ... # type: ignore[overload-overlap] +def ord_(dta: str) -> int: ... @overload def ord_(dta: _T) -> _T: ... def make_string(seq: str | list[int]) -> str: ... diff --git a/stubs/Flask-Cors/flask_cors/core.pyi b/stubs/Flask-Cors/flask_cors/core.pyi index c9fdecadb93e..c34cc49d6849 100644 --- a/stubs/Flask-Cors/flask_cors/core.pyi +++ b/stubs/Flask-Cors/flask_cors/core.pyi @@ -60,7 +60,7 @@ def serialize_option(options_dict: _Options, key: str, upper: bool = False) -> N @overload def ensure_iterable(inst: str) -> list[str]: ... # type: ignore[overload-overlap] @overload -def ensure_iterable(inst: _IterableT) -> _IterableT: ... +def ensure_iterable(inst: _IterableT) -> _IterableT: ... # type: ignore[overload-overlap] @overload def ensure_iterable(inst: _T) -> list[_T]: ... def sanitize_regex_param(param: str | list[str]) -> list[str]: ... diff --git a/stubs/boto/boto/auth.pyi b/stubs/boto/boto/auth.pyi index 108d14bdd11a..7af7cd902102 100644 --- a/stubs/boto/boto/auth.pyi +++ b/stubs/boto/boto/auth.pyi @@ -40,7 +40,7 @@ class HmacAuthV3HTTPHandler(AuthHandler, HmacKeys): def headers_to_sign(self, http_request): ... def canonical_headers(self, headers_to_sign): ... def string_to_sign(self, http_request): ... - def add_auth(self, req, **kwargs): ... + def add_auth(self, req, **kwargs): ... # type: ignore[override] class HmacAuthV4Handler(AuthHandler, HmacKeys): capability: Any @@ -65,7 +65,7 @@ class HmacAuthV4Handler(AuthHandler, HmacKeys): def credential_scope(self, http_request): ... def string_to_sign(self, http_request, canonical_request): ... def signature(self, http_request, string_to_sign): ... - def add_auth(self, req, **kwargs): ... + def add_auth(self, req, **kwargs): ... # type: ignore[override] class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): capability: Any @@ -80,7 +80,7 @@ class S3HmacAuthV4Handler(HmacAuthV4Handler, AuthHandler): def determine_service_name(self, host): ... def mangle_path_and_params(self, req): ... def payload(self, http_request): ... - def add_auth(self, req, **kwargs): ... + def add_auth(self, req, **kwargs): ... # type: ignore[override] def presign(self, req, expires, iso_date: Incomplete | None = None): ... class STSAnonHandler(AuthHandler): @@ -105,7 +105,7 @@ class QuerySignatureV2AuthHandler(QuerySignatureHelper, AuthHandler): class POSTPathQSV2AuthHandler(QuerySignatureV2AuthHandler, AuthHandler): capability: Any - def add_auth(self, req, **kwargs): ... + def add_auth(self, req, **kwargs): ... # type: ignore[override] def get_auth_handler(host, config, provider, requested_capability: Incomplete | None = None): ... def detect_potential_sigv4(func): ... diff --git a/stubs/docker/docker/models/secrets.pyi b/stubs/docker/docker/models/secrets.pyi index 8bc82ead883a..802e58ffc796 100644 --- a/stubs/docker/docker/models/secrets.pyi +++ b/stubs/docker/docker/models/secrets.pyi @@ -8,6 +8,6 @@ class Secret(Model): class SecretCollection(Collection[Secret]): model: type[Secret] - def create(self, **kwargs): ... + def create(self, **kwargs): ... # type: ignore[override] def get(self, secret_id): ... def list(self, **kwargs): ... diff --git a/stubs/docker/docker/transport/sshconn.pyi b/stubs/docker/docker/transport/sshconn.pyi index 2edb07590003..42d703e778a5 100644 --- a/stubs/docker/docker/transport/sshconn.pyi +++ b/stubs/docker/docker/transport/sshconn.pyi @@ -15,9 +15,9 @@ class SSHSocket(socket.socket): def __init__(self, host) -> None: ... def connect(self, **kwargs) -> None: ... # type:ignore[override] def sendall(self, data) -> None: ... # type:ignore[override] - def send(self, data): ... - def recv(self, n): ... - def makefile(self, mode): ... + def send(self, data): ... # type:ignore[override] + def recv(self, n): ... # type:ignore[override] + def makefile(self, mode): ... # type:ignore[override] def close(self) -> None: ... class SSHConnection(urllib3.connection.HTTPConnection): diff --git a/stubs/first/first.pyi b/stubs/first/first.pyi index 03997de59226..17fe072b2fe0 100644 --- a/stubs/first/first.pyi +++ b/stubs/first/first.pyi @@ -14,4 +14,6 @@ def first(iterable: Iterable[_T], default: _S) -> _T | _S: ... @overload def first(iterable: Iterable[_T], default: _S, key: Callable[[_T], Any] | None) -> _T | _S: ... @overload +def first(iterable: Iterable[_T], default: None, key: Callable[[_T], Any] | None) -> _T | None: ... +@overload def first(iterable: Iterable[_T], *, key: Callable[[_T], Any] | None) -> _T | None: ... diff --git a/stubs/gevent/gevent/timeout.pyi b/stubs/gevent/gevent/timeout.pyi index abfa0b56b541..341fd2479f1a 100644 --- a/stubs/gevent/gevent/timeout.pyi +++ b/stubs/gevent/gevent/timeout.pyi @@ -43,6 +43,8 @@ class Timeout(BaseException): # when timeout_value is provided we unfortunately get no type checking on *args, **kwargs, because # ParamSpec does not allow mixing in additional keyword arguments @overload -def with_timeout(seconds: float | None, function: Callable[..., _T1], *args: Any, timeout_value: _T2, **kwds: Any) -> _T1 | _T2: ... # type: ignore[misc] +def with_timeout( + seconds: float | None, function: Callable[..., _T1], *args: Any, timeout_value: _T2, **kwds: Any +) -> _T1 | _T2: ... @overload def with_timeout(seconds: float | None, function: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T: ... diff --git a/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi b/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi index 811eb180cd53..e40a6ddb344f 100644 --- a/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi +++ b/stubs/google-cloud-ndb/google/cloud/ndb/_cache.pyi @@ -34,12 +34,12 @@ class _GlobalCacheSetBatch(_GlobalCacheBatch): def done_callback(self, cache_call) -> None: ... def add(self, key, value): ... def make_call(self): ... - def future_info(self, key, value): ... + def future_info(self, key, value): ... # type:ignore[override] class _GlobalCacheSetIfNotExistsBatch(_GlobalCacheSetBatch): def add(self, key, value): ... def make_call(self): ... - def future_info(self, key, value): ... + def future_info(self, key, value): ... # type:ignore[override] global_delete: Any @@ -55,7 +55,7 @@ global_watch: Any class _GlobalCacheWatchBatch(_GlobalCacheDeleteBatch): def make_call(self): ... - def future_info(self, key, value): ... + def future_info(self, key, value): ... # type:ignore[override] def global_unwatch(key): ... @@ -67,7 +67,7 @@ global_compare_and_swap: Any class _GlobalCacheCompareAndSwapBatch(_GlobalCacheSetBatch): def make_call(self): ... - def future_info(self, key, value): ... + def future_info(self, key, value): ... # type:ignore[override] def is_locked_value(value): ... def global_cache_key(key): ... diff --git a/stubs/html5lib/html5lib/_utils.pyi b/stubs/html5lib/html5lib/_utils.pyi index 50ee4e5d03c8..7401d338c649 100644 --- a/stubs/html5lib/html5lib/_utils.pyi +++ b/stubs/html5lib/html5lib/_utils.pyi @@ -15,7 +15,7 @@ class BoundMethodDispatcher(Mapping[Any, Any]): dispatcher: Any def __init__(self, instance, dispatcher) -> None: ... def __getitem__(self, key): ... - def get(self, key, default): ... + def get(self, key, default): ... # type: ignore[override] def __iter__(self): ... def __len__(self) -> int: ... def __contains__(self, key): ... diff --git a/stubs/icalendar/icalendar/parser_tools.pyi b/stubs/icalendar/icalendar/parser_tools.pyi index 5badc5621d35..9525b4feef61 100644 --- a/stubs/icalendar/icalendar/parser_tools.pyi +++ b/stubs/icalendar/icalendar/parser_tools.pyi @@ -8,10 +8,10 @@ DEFAULT_ENCODING: str def from_unicode(value: str | bytes, encoding: str = "utf-8") -> bytes: ... def to_unicode(value: str | bytes, encoding: str = "utf-8") -> str: ... @overload -def data_encode(data: str, encoding: str = ...) -> bytes: ... # type: ignore[misc] +def data_encode(data: str, encoding: str = ...) -> bytes: ... @overload def data_encode(data: dict[Any, Any], encoding: str = ...) -> dict[Any, Any]: ... @overload -def data_encode(data: list[Any] | tuple[Any, ...], encoding: str = ...) -> list[Any]: ... # type: ignore[misc] +def data_encode(data: list[Any] | tuple[Any, ...], encoding: str = ...) -> list[Any]: ... @overload def data_encode(data: _T, encoding: str = ...) -> _T: ... diff --git a/stubs/networkx/networkx/classes/reportviews.pyi b/stubs/networkx/networkx/classes/reportviews.pyi index b984c8929da2..caeeedceb27f 100644 --- a/stubs/networkx/networkx/classes/reportviews.pyi +++ b/stubs/networkx/networkx/classes/reportviews.pyi @@ -72,7 +72,7 @@ class OutEdgeView(AbstractSet[Incomplete], Mapping[Incomplete, Incomplete], Gene def __contains__(self, e: _Edge[_Node]) -> bool: ... # type: ignore[override] def __getitem__(self, e: _Edge[_Node]) -> dict[str, Any]: ... @overload - def __call__(self, nbunch: None = None, data: Literal[False] = False, *, default: Unused = None) -> Self: ... + def __call__(self, nbunch: None = None, data: Literal[False] = False, *, default: Unused = None) -> Self: ... # type: ignore[overload-overlap] @overload def __call__( self, nbunch: _Node | Iterable[_Node], data: Literal[False] = False, *, default: None = None diff --git a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi index 2a0c5d02e8f3..c977ff3928cb 100644 --- a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi +++ b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/authorization_code.pyi @@ -8,4 +8,4 @@ log: Any class AuthorizationCodeGrant(GrantTypeBase): proxy_target: Any def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ... - def add_id_token(self, token, token_handler, request): ... + def add_id_token(self, token, token_handler, request): ... # type: ignore[override] diff --git a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi index 54daa5e09c49..042510bacdec 100644 --- a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi +++ b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/hybrid.pyi @@ -12,5 +12,5 @@ class HybridGrant(GrantTypeBase): request_validator: Any proxy_target: Any def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ... - def add_id_token(self, token, token_handler, request): ... + def add_id_token(self, token, token_handler, request): ... # type: ignore[override] def openid_authorization_validator(self, request): ... diff --git a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi index 134af4c4bf31..136f25661891 100644 --- a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi +++ b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/implicit.pyi @@ -8,5 +8,5 @@ log: Any class ImplicitGrant(GrantTypeBase): proxy_target: Any def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ... - def add_id_token(self, token, token_handler, request): ... + def add_id_token(self, token, token_handler, request): ... # type: ignore[override] def openid_authorization_validator(self, request): ... diff --git a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/refresh_token.pyi b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/refresh_token.pyi index 2cba6badd0b7..810e4f8dbfc6 100644 --- a/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/refresh_token.pyi +++ b/stubs/oauthlib/oauthlib/openid/connect/core/grant_types/refresh_token.pyi @@ -7,4 +7,4 @@ log: Incomplete class RefreshTokenGrant(GrantTypeBase): proxy_target: Incomplete def __init__(self, request_validator: Incomplete | None = None, **kwargs) -> None: ... - def add_id_token(self, token, token_handler, request): ... + def add_id_token(self, token, token_handler, request): ... # type: ignore[override] diff --git a/stubs/olefile/olefile/olefile.pyi b/stubs/olefile/olefile/olefile.pyi index 7637bf9d319a..bc7d74306ae4 100644 --- a/stubs/olefile/olefile/olefile.pyi +++ b/stubs/olefile/olefile/olefile.pyi @@ -166,9 +166,9 @@ class OleDirectoryEntry(Generic[AnyStr]): def build_storage_tree(self) -> None: ... def append_kids(self, child_sid: int) -> None: ... def __eq__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override] - def __lt__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override] + def __lt__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... def __ne__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override] - def __le__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... # type: ignore[override] + def __le__(self, other: OleDirectoryEntry[AnyStr]) -> bool: ... def dump(self, tab: int = 0) -> None: ... def getmtime(self) -> datetime.datetime | None: ... def getctime(self) -> datetime.datetime | None: ... diff --git a/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 03727c2aa932..c2424b239ca5 100644 --- a/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -37,7 +37,7 @@ class Nested(Descriptor[_T]): def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_T] | _T) -> None: ... def from_tree(self, node: _HasGet[_T]) -> _T: ... @overload - def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... # type: ignore[overload-overlap] + def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... @overload def to_tree(self, tagname: str, value: object, namespace: str | None = None) -> Element: ... @@ -155,7 +155,7 @@ class NestedText(NestedValue[_T, _N]): def __set__(self: NestedText[_T, Literal[True]], instance: Serialisable | Strict, value: _T | int | Any | None) -> None: ... def from_tree(self, node: _HasText) -> str: ... # type: ignore[override] @overload - def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... # type: ignore[overload-overlap] + def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... @overload def to_tree(self, tagname: str, value: object, namespace: str | None = None) -> Element: ... @@ -271,8 +271,6 @@ class EmptyTag(Nested[bool], Bool[_N]): # type: ignore[misc] def __set__(self, instance: Serialisable | Strict, value: _HasTagAndGet[_ConvertibleToBool] | _ConvertibleToBool) -> None: ... def from_tree(self, node: Unused) -> Literal[True]: ... @overload - def to_tree( # type: ignore[overload-overlap] - self, tagname: Unused = None, value: None = None, namespace: Unused = None - ) -> None: ... + def to_tree(self, tagname: Unused = None, value: None = None, namespace: Unused = None) -> None: ... @overload def to_tree(self, tagname: str, value: object, namespace: str | None = None) -> Element: ... diff --git a/stubs/openpyxl/openpyxl/styles/named_styles.pyi b/stubs/openpyxl/openpyxl/styles/named_styles.pyi index 6eea540f39c1..157ad8864db4 100644 --- a/stubs/openpyxl/openpyxl/styles/named_styles.pyi +++ b/stubs/openpyxl/openpyxl/styles/named_styles.pyi @@ -44,7 +44,7 @@ class NamedStyle(Serialisable): def as_name(self) -> _NamedCellStyle: ... class NamedStyleList(list[NamedStyle]): - def __init__(self, iterable: Iterable[NamedStyle] = ()) -> None: ... # type: ignore[override] + def __init__(self, iterable: Iterable[NamedStyle] = ()) -> None: ... @property def names(self) -> list[str]: ... def __getitem__(self, key: int | str) -> NamedStyle: ... # type: ignore[override] diff --git a/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi b/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi index 910a86b6c885..cbdac51f363c 100644 --- a/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi +++ b/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi @@ -77,7 +77,7 @@ def fromstring(text: str | ReadableBuffer, parser: XMLParser | None = None) -> E # from lxml.etree import fromstring # But made partial, removing parser arg @overload -def fromstring(text: str | bytes, *, base_url: str | bytes = ...) -> _lxml_Element: ... # type: ignore[overload-overlap] +def fromstring(text: str | bytes, *, base_url: str | bytes = ...) -> _lxml_Element: ... # from defusedxml.ElementTree import fromstring @overload diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index 672dcb444036..dc5c1642e783 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -239,13 +239,13 @@ class ColumnBase(Node): def __invert__(self): ... __and__: Incomplete __or__: Incomplete - __add__: Callable[[Self, Any], Expression] + def __add__(self, rhs: Any) -> Expression: ... __sub__: Incomplete __mul__: Callable[[Self, Any], Expression] __div__: Callable[[Self, Any], Expression] __truediv__: Callable[[Self, Any], Expression] __xor__: Callable[[Self, Any], Expression] - __radd__: Callable[[Self, Any], Expression] + def __radd__(self, rhs: Any) -> Expression: ... __rsub__: Callable[[Self, Any], Expression] __rmul__: Callable[[Self, Any], Expression] __rdiv__: Callable[[Self, Any], Expression] diff --git a/stubs/pexpect/pexpect/popen_spawn.pyi b/stubs/pexpect/pexpect/popen_spawn.pyi index 84e524ff50fb..a13b49b6cc21 100644 --- a/stubs/pexpect/pexpect/popen_spawn.pyi +++ b/stubs/pexpect/pexpect/popen_spawn.pyi @@ -23,7 +23,7 @@ class PopenSpawn(SpawnBase[AnyStr]): preexec_fn: Callable[[], None] | None = None, ) -> None: ... flag_eof: bool - def read_nonblocking(self, size, timeout): ... + def read_nonblocking(self, size, timeout): ... # type: ignore[override] def write(self, s) -> None: ... def writelines(self, sequence) -> None: ... def send(self, s): ... diff --git a/stubs/pycocotools/pycocotools/mask.pyi b/stubs/pycocotools/pycocotools/mask.pyi index 1571d7bd987d..37825152c91f 100644 --- a/stubs/pycocotools/pycocotools/mask.pyi +++ b/stubs/pycocotools/pycocotools/mask.pyi @@ -22,7 +22,7 @@ def merge(rleObjs: list[_EncodedRLE], intersect: int = ...) -> _EncodedRLE: ... # ignore an "overlapping overloads" error due to _NDArrayInt32 being an alias for `Incomplete` for now @overload -def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ... # type: ignore[overload-overlap] +def frPyObjects(pyobj: _NDArrayUInt32 | list[list[int]] | list[_EncodedRLE], h: int, w: int) -> list[_EncodedRLE]: ... @overload def frPyObjects(pyobj: list[int] | _EncodedRLE, h: int, w: int) -> _EncodedRLE: ... def encode(bimask: _NDArrayUInt8) -> _EncodedRLE: ... diff --git a/stubs/pywin32/win32comext/axdebug/stackframe.pyi b/stubs/pywin32/win32comext/axdebug/stackframe.pyi index 63832412bc95..931a1013b59c 100644 --- a/stubs/pywin32/win32comext/axdebug/stackframe.pyi +++ b/stubs/pywin32/win32comext/axdebug/stackframe.pyi @@ -17,7 +17,7 @@ class DebugStackFrame(gateways.DebugStackFrame): def GetThread(self) -> None: ... def GetCodeContext(self): ... def GetDescriptionString(self, fLong): ... - def GetLanguageString(self, fLong): ... + def GetLanguageString(self, fLong): ... # type: ignore[override] def GetDebugProperty(self): ... class DebugStackFrameSniffer: diff --git a/stubs/redis/redis/commands/core.pyi b/stubs/redis/redis/commands/core.pyi index e921f1a64d55..dfe2c569bf05 100644 --- a/stubs/redis/redis/commands/core.pyi +++ b/stubs/redis/redis/commands/core.pyi @@ -1023,7 +1023,7 @@ class SortedSetCommands(Generic[_StrType]): @overload def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ... @overload - def zrange( + def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1037,7 +1037,7 @@ class SortedSetCommands(Generic[_StrType]): num: int | None = None, ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - def zrange( + def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1051,7 +1051,7 @@ class SortedSetCommands(Generic[_StrType]): num: int | None = None, ) -> list[tuple[_StrType, float]]: ... @overload - def zrange( + def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1065,7 +1065,7 @@ class SortedSetCommands(Generic[_StrType]): num: int | None = None, ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - def zrange( + def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1102,7 +1102,9 @@ class SortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn], ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - def zrevrange(self, name: _Key, start: int, end: int, withscores: Literal[True]) -> list[tuple[_StrType, float]]: ... + def zrevrange( # type: ignore[overload-overlap] + self, name: _Key, start: int, end: int, withscores: Literal[True] + ) -> list[tuple[_StrType, float]]: ... @overload def zrevrange( self, name: _Key, start: int, end: int, withscores: bool = False, score_cast_func: Callable[[Any], Any] = ... @@ -1126,7 +1128,7 @@ class SortedSetCommands(Generic[_StrType]): self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None ) -> list[_StrType]: ... @overload - def zrangebyscore( + def zrangebyscore( # type: ignore[overload-overlap] self, name: _Key, min: _Value, @@ -1138,7 +1140,7 @@ class SortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn], ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - def zrangebyscore( + def zrangebyscore( # type: ignore[overload-overlap] self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True] ) -> list[tuple[_StrType, float]]: ... @overload @@ -1153,7 +1155,7 @@ class SortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], Any] = ..., ) -> list[_StrType]: ... @overload - def zrevrangebyscore( + def zrevrangebyscore( # type: ignore[overload-overlap] self, name: _Key, max: _Value, @@ -1165,7 +1167,7 @@ class SortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn], ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - def zrevrangebyscore( + def zrevrangebyscore( # type: ignore[overload-overlap] self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True] ) -> list[tuple[_StrType, float]]: ... @overload @@ -1224,7 +1226,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): @overload async def bzpopmin(self, keys: _Key | Iterable[_Key], timeout: float) -> tuple[_StrType, _StrType, float] | None: ... @overload - async def zrange( + async def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1238,7 +1240,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): num: int | None = None, ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - async def zrange( + async def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1252,7 +1254,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): num: int | None = None, ) -> list[tuple[_StrType, float]]: ... @overload - async def zrange( + async def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1267,7 +1269,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): num: int | None = None, ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - async def zrange( + async def zrange( # type: ignore[overload-overlap] self, name: _Key, start: int, @@ -1305,7 +1307,9 @@ class AsyncSortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn], ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - async def zrevrange(self, name: _Key, start: int, end: int, withscores: Literal[True]) -> list[tuple[_StrType, float]]: ... + async def zrevrange( # type: ignore[overload-overlap] + self, name: _Key, start: int, end: int, withscores: Literal[True] + ) -> list[tuple[_StrType, float]]: ... @overload async def zrevrange( self, name: _Key, start: int, end: int, withscores: bool = False, score_cast_func: Callable[[Any], Any] = ... @@ -1329,7 +1333,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None ) -> list[_StrType]: ... @overload - async def zrangebyscore( + async def zrangebyscore( # type: ignore[overload-overlap] self, name: _Key, min: _Value, @@ -1341,7 +1345,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn], ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - async def zrangebyscore( + async def zrangebyscore( # type: ignore[overload-overlap] self, name: _Key, min: _Value, max: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True] ) -> list[tuple[_StrType, float]]: ... @overload @@ -1356,7 +1360,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], Any] = ..., ) -> list[_StrType]: ... @overload - async def zrevrangebyscore( + async def zrevrangebyscore( # type: ignore[overload-overlap] self, name: _Key, max: _Value, @@ -1368,7 +1372,7 @@ class AsyncSortedSetCommands(Generic[_StrType]): score_cast_func: Callable[[_StrType], _ScoreCastFuncReturn], ) -> list[tuple[_StrType, _ScoreCastFuncReturn]]: ... @overload - async def zrevrangebyscore( + async def zrevrangebyscore( # type: ignore[overload-overlap] self, name: _Key, max: _Value, min: _Value, start: int | None = None, num: int | None = None, *, withscores: Literal[True] ) -> list[tuple[_StrType, float]]: ... @overload diff --git a/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi b/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi index c51454be9b57..9b451f3d0ef9 100644 --- a/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi +++ b/stubs/reportlab/reportlab/lib/rl_safe_eval.pyi @@ -48,7 +48,8 @@ class UntrustedAstTransformer(ast.NodeTransformer): def visit_Subscript(self, node): ... def visit_Assign(self, node): ... def visit_AugAssign(self, node): ... - def visit_While(node): ... + # Bug in `reportlab`'s source code: + def visit_While(node): ... # type: ignore[override] def visit_ExceptHandler(self, node): ... def visit_With(self, node): ... def visit_FunctionDef(self, node): ... diff --git a/stubs/setuptools/pkg_resources/__init__.pyi b/stubs/setuptools/pkg_resources/__init__.pyi index 2187fde20a5c..fe0ca42441a3 100644 --- a/stubs/setuptools/pkg_resources/__init__.pyi +++ b/stubs/setuptools/pkg_resources/__init__.pyi @@ -124,7 +124,7 @@ class WorkingSet: def __iter__(self) -> Iterator[Distribution]: ... def add(self, dist: Distribution, entry: str | None = None, insert: bool = True, replace: bool = False) -> None: ... @overload - def resolve( # type: ignore[overload-overlap] + def resolve( self, requirements: Iterable[Requirement], env: Environment | None, @@ -133,7 +133,7 @@ class WorkingSet: extras: tuple[str, ...] | None = None, ) -> list[_DistributionT]: ... @overload - def resolve( # type: ignore[overload-overlap] + def resolve( self, requirements: Iterable[Requirement], env: Environment | None = None, @@ -143,7 +143,7 @@ class WorkingSet: extras: tuple[str, ...] | None = None, ) -> list[_DistributionT]: ... @overload - def resolve( # type: ignore[overload-overlap] + def resolve( self, requirements: Iterable[Requirement], env: Environment | None = None, @@ -152,7 +152,7 @@ class WorkingSet: extras: tuple[str, ...] | None = None, ) -> list[Distribution]: ... @overload - def find_plugins( # type: ignore[overload-overlap] + def find_plugins( self, plugin_env: Environment, full_env: Environment | None, @@ -160,7 +160,7 @@ class WorkingSet: fallback: bool = True, ) -> tuple[list[_DistributionT], dict[Distribution, Exception]]: ... @overload - def find_plugins( # type: ignore[overload-overlap] + def find_plugins( self, plugin_env: Environment, full_env: Environment | None = None, @@ -205,7 +205,7 @@ class Environment: replace_conflicting: bool = False, ) -> Distribution | None: ... @overload - def obtain(self, requirement: Requirement, installer: _InstallerTypeT[_DistributionT]) -> _DistributionT: ... # type: ignore[overload-overlap] + def obtain(self, requirement: Requirement, installer: _InstallerTypeT[_DistributionT]) -> _DistributionT: ... @overload def obtain(self, requirement: Requirement, installer: Callable[[Requirement], None] | None = None) -> None: ... @overload diff --git a/stubs/setuptools/setuptools/__init__.pyi b/stubs/setuptools/setuptools/__init__.pyi index a044e09d3726..0bfb669200d9 100644 --- a/stubs/setuptools/setuptools/__init__.pyi +++ b/stubs/setuptools/setuptools/__init__.pyi @@ -79,7 +79,7 @@ class Command(_Command): # Any: Dynamic command subclass attributes def __init__(self, dist: Distribution, **kw: Any) -> None: ... def ensure_string_list(self, option: str) -> None: ... - @overload # type: ignore[override] # Extra **kw param + @overload # Extra **kw param def reinitialize_command(self, command: str, reinit_subcommands: bool = False, **kw) -> _Command: ... @overload def reinitialize_command(self, command: _CommandT, reinit_subcommands: bool = False, **kw) -> _CommandT: ...