From d0f2be92aba2e007841eec073cb47d7f86722792 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 24 Apr 2024 13:09:16 +0100 Subject: [PATCH] Bump pyright to v1.1.360 (#11810) --- requirements-tests.txt | 2 +- stdlib/builtins.pyi | 16 ++++++++-- stdlib/collections/__init__.pyi | 31 ++++++++++++++----- stdlib/contextlib.pyi | 4 +-- stdlib/logging/__init__.pyi | 2 +- stdlib/unittest/mock.pyi | 4 +-- stdlib/weakref.pyi | 11 +++++-- stubs/PyMySQL/pymysql/connections.pyi | 3 +- stubs/WTForms/wtforms/fields/form.pyi | 2 +- stubs/WTForms/wtforms/fields/list.pyi | 2 +- stubs/WebOb/webob/dec.pyi | 8 ++--- stubs/gevent/gevent/_fileobjectcommon.pyi | 4 ++- stubs/gevent/gevent/_util.pyi | 4 ++- stubs/gevent/gevent/greenlet.pyi | 7 ++++- stubs/libsass/sass.pyi | 16 ++++++++-- stubs/mock/mock/mock.pyi | 2 +- stubs/openpyxl/openpyxl/descriptors/base.pyi | 8 ++--- .../openpyxl/openpyxl/descriptors/nested.pyi | 10 +++--- stubs/redis/redis/asyncio/connection.pyi | 6 ++-- stubs/uWSGI/uwsgidecorators.pyi | 4 +-- 20 files changed, 100 insertions(+), 46 deletions(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index eaaa1f42c..776b52cb4 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -7,7 +7,7 @@ flake8-noqa==1.4.0 # must match .pre-commit-config.yaml flake8-pyi==24.4.1 # must match .pre-commit-config.yaml mypy==1.9.0 pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml -pyright==1.1.358 +pyright==1.1.360 pytype==2024.4.11; platform_system != "Windows" and python_version < "3.12" ruff==0.3.7 # must match .pre-commit-config.yaml diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index f531c181b..a58b504a9 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1031,15 +1031,25 @@ class dict(MutableMapping[_KT, _VT]): @overload def __init__(self) -> None: ... @overload - def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ... + def __init__(self: dict[str, _VT], **kwargs: _VT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 @overload def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ... @overload - def __init__(self: dict[str, _VT], map: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> None: ... + def __init__( + self: dict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + map: SupportsKeysAndGetItem[str, _VT], + /, + **kwargs: _VT, + ) -> None: ... @overload def __init__(self, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ... @overload - def __init__(self: dict[str, _VT], iterable: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> None: ... + def __init__( + self: dict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + iterable: Iterable[tuple[str, _VT]], + /, + **kwargs: _VT, + ) -> None: ... # Next two overloads are for dict(string.split(sep) for string in iterable) # Cannot be Iterable[Sequence[_T]] or otherwise dict(["foo", "bar", "baz"]) is not an error @overload diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index 1d23ecd66..71e3c564d 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -51,15 +51,27 @@ class UserDict(MutableMapping[_KT, _VT]): @overload def __init__(self, dict: None = None, /) -> None: ... @overload - def __init__(self: UserDict[str, _VT], dict: None = None, /, **kwargs: _VT) -> None: ... + def __init__( + self: UserDict[str, _VT], dict: None = None, /, **kwargs: _VT # pyright: ignore[reportInvalidTypeVarUse] #11780 + ) -> None: ... @overload def __init__(self, dict: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ... @overload - def __init__(self: UserDict[str, _VT], dict: SupportsKeysAndGetItem[str, _VT], /, **kwargs: _VT) -> None: ... + def __init__( + self: UserDict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + dict: SupportsKeysAndGetItem[str, _VT], + /, + **kwargs: _VT, + ) -> None: ... @overload def __init__(self, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ... @overload - def __init__(self: UserDict[str, _VT], iterable: Iterable[tuple[str, _VT]], /, **kwargs: _VT) -> None: ... + def __init__( + self: UserDict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + iterable: Iterable[tuple[str, _VT]], + /, + **kwargs: _VT, + ) -> None: ... @overload def __init__(self: UserDict[str, str], iterable: Iterable[list[str]], /) -> None: ... @overload @@ -389,16 +401,21 @@ class defaultdict(dict[_KT, _VT]): @overload def __init__(self) -> None: ... @overload - def __init__(self: defaultdict[str, _VT], **kwargs: _VT) -> None: ... + def __init__(self: defaultdict[str, _VT], **kwargs: _VT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 @overload def __init__(self, default_factory: Callable[[], _VT] | None, /) -> None: ... @overload - def __init__(self: defaultdict[str, _VT], default_factory: Callable[[], _VT] | None, /, **kwargs: _VT) -> None: ... + def __init__( + self: defaultdict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + default_factory: Callable[[], _VT] | None, + /, + **kwargs: _VT, + ) -> None: ... @overload def __init__(self, default_factory: Callable[[], _VT] | None, map: SupportsKeysAndGetItem[_KT, _VT], /) -> None: ... @overload def __init__( - self: defaultdict[str, _VT], + self: defaultdict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 default_factory: Callable[[], _VT] | None, map: SupportsKeysAndGetItem[str, _VT], /, @@ -408,7 +425,7 @@ class defaultdict(dict[_KT, _VT]): def __init__(self, default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[_KT, _VT]], /) -> None: ... @overload def __init__( - self: defaultdict[str, _VT], + self: defaultdict[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 default_factory: Callable[[], _VT] | None, iterable: Iterable[tuple[str, _VT]], /, diff --git a/stdlib/contextlib.pyi b/stdlib/contextlib.pyi index c5881a9db..29ac7cde5 100644 --- a/stdlib/contextlib.pyi +++ b/stdlib/contextlib.pyi @@ -183,7 +183,7 @@ if sys.version_info >= (3, 10): @overload def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload - def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... + def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 def __enter__(self) -> _T: ... def __exit__(self, *exctype: Unused) -> None: ... async def __aenter__(self) -> _T: ... @@ -195,7 +195,7 @@ else: @overload def __init__(self: nullcontext[None], enter_result: None = None) -> None: ... @overload - def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... + def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 def __enter__(self) -> _T: ... def __exit__(self, *exctype: Unused) -> None: ... diff --git a/stdlib/logging/__init__.pyi b/stdlib/logging/__init__.pyi index a62d0674d..f5f7f91ec 100644 --- a/stdlib/logging/__init__.pyi +++ b/stdlib/logging/__init__.pyi @@ -597,7 +597,7 @@ class StreamHandler(Handler, Generic[_StreamT]): @overload def __init__(self: StreamHandler[TextIO], stream: None = None) -> None: ... @overload - def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... + def __init__(self: StreamHandler[_StreamT], stream: _StreamT) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 def setStream(self, stream: _StreamT) -> _StreamT | None: ... if sys.version_info >= (3, 11): def __class_getitem__(cls, item: Any) -> GenericAlias: ... diff --git a/stdlib/unittest/mock.pyi b/stdlib/unittest/mock.pyi index 6e64e7a85..dd61b83a6 100644 --- a/stdlib/unittest/mock.pyi +++ b/stdlib/unittest/mock.pyi @@ -188,7 +188,7 @@ class _patch(Generic[_T]): # but that's impossible with the current type system. if sys.version_info >= (3, 10): def __init__( - self: _patch[_T], + self: _patch[_T], # pyright: ignore[reportInvalidTypeVarUse] #11780 getter: Callable[[], Any], attribute: str, new: _T, @@ -203,7 +203,7 @@ class _patch(Generic[_T]): ) -> None: ... else: def __init__( - self: _patch[_T], + self: _patch[_T], # pyright: ignore[reportInvalidTypeVarUse] #11780 getter: Callable[[], Any], attribute: str, new: _T, diff --git a/stdlib/weakref.pyi b/stdlib/weakref.pyi index 8f3ad0631..e34512423 100644 --- a/stdlib/weakref.pyi +++ b/stdlib/weakref.pyi @@ -51,10 +51,17 @@ class WeakValueDictionary(MutableMapping[_KT, _VT]): @overload def __init__(self) -> None: ... @overload - def __init__(self: WeakValueDictionary[_KT, _VT], other: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]], /) -> None: ... + def __init__( + self: WeakValueDictionary[_KT, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + other: Mapping[_KT, _VT] | Iterable[tuple[_KT, _VT]], + /, + ) -> None: ... @overload def __init__( - self: WeakValueDictionary[str, _VT], other: Mapping[str, _VT] | Iterable[tuple[str, _VT]] = (), /, **kwargs: _VT + self: WeakValueDictionary[str, _VT], # pyright: ignore[reportInvalidTypeVarUse] #11780 + other: Mapping[str, _VT] | Iterable[tuple[str, _VT]] = (), + /, + **kwargs: _VT, ) -> None: ... def __len__(self) -> int: ... def __getitem__(self, key: _KT) -> _VT: ... diff --git a/stubs/PyMySQL/pymysql/connections.pyi b/stubs/PyMySQL/pymysql/connections.pyi index 8564d19f1..9e45e9958 100644 --- a/stubs/PyMySQL/pymysql/connections.pyi +++ b/stubs/PyMySQL/pymysql/connections.pyi @@ -124,7 +124,8 @@ class Connection(Generic[_C]): ) -> None: ... @overload def __init__( - self: Connection[_C], # different between overloads + # different between overloads: + self: Connection[_C], # pyright: ignore[reportInvalidTypeVarUse] #11780 *, host: str | None = None, user: Incomplete | None = None, diff --git a/stubs/WTForms/wtforms/fields/form.pyi b/stubs/WTForms/wtforms/fields/form.pyi index fe9c694d1..3b029e263 100644 --- a/stubs/WTForms/wtforms/fields/form.pyi +++ b/stubs/WTForms/wtforms/fields/form.pyi @@ -12,7 +12,7 @@ class FormField(Field, Generic[_BoundFormT]): form: _BoundFormT separator: str def __init__( - self: FormField[_BoundFormT], + self: FormField[_BoundFormT], # pyright: ignore[reportInvalidTypeVarUse] #11780 form_class: type[_BoundFormT], label: str | None = None, validators: None = None, diff --git a/stubs/WTForms/wtforms/fields/list.pyi b/stubs/WTForms/wtforms/fields/list.pyi index 4ce857d67..f5fe3eda7 100644 --- a/stubs/WTForms/wtforms/fields/list.pyi +++ b/stubs/WTForms/wtforms/fields/list.pyi @@ -15,7 +15,7 @@ class FieldList(Field, Generic[_BoundFieldT]): entries: list[_BoundFieldT] object_data: Iterable[Any] def __init__( - self: FieldList[_BoundFieldT], + self: FieldList[_BoundFieldT], # pyright: ignore[reportInvalidTypeVarUse] #11780 # because of our workaround we need to accept Field as well unbound_field: UnboundField[_BoundFieldT] | _BoundFieldT, label: str | None = None, diff --git a/stubs/WebOb/webob/dec.pyi b/stubs/WebOb/webob/dec.pyi index 40e966c3d..3f3d76fd0 100644 --- a/stubs/WebOb/webob/dec.pyi +++ b/stubs/WebOb/webob/dec.pyi @@ -45,7 +45,7 @@ class wsgify(Generic[_RequestT_contra, _P]): ) -> None: ... @overload def __init__( - self: wsgify[_RequestT_contra, []], + self: wsgify[_RequestT_contra, []], # pyright: ignore[reportInvalidTypeVarUse] #11780 func: _RequestHandler[_RequestT_contra, []] | None, RequestClass: type[_RequestT_contra], args: tuple[()] = (), @@ -54,7 +54,7 @@ class wsgify(Generic[_RequestT_contra, _P]): ) -> None: ... @overload def __init__( - self: wsgify[_RequestT_contra, []], + self: wsgify[_RequestT_contra, []], # pyright: ignore[reportInvalidTypeVarUse] #11780 func: _RequestHandler[_RequestT_contra, []] | None = None, *, RequestClass: type[_RequestT_contra], @@ -74,7 +74,7 @@ class wsgify(Generic[_RequestT_contra, _P]): ) -> None: ... @overload def __init__( - self: wsgify[_RequestT_contra, [_AppT_contra]], + self: wsgify[_RequestT_contra, [_AppT_contra]], # pyright: ignore[reportInvalidTypeVarUse] #11780 func: _Middleware[_RequestT_contra, _AppT_contra, []] | None, RequestClass: type[_RequestT_contra], args: tuple[()] = (), @@ -84,7 +84,7 @@ class wsgify(Generic[_RequestT_contra, _P]): ) -> None: ... @overload def __init__( - self: wsgify[_RequestT_contra, [_AppT_contra]], + self: wsgify[_RequestT_contra, [_AppT_contra]], # pyright: ignore[reportInvalidTypeVarUse] #11780 func: _Middleware[_RequestT_contra, _AppT_contra, []] | None = None, *, RequestClass: type[_RequestT_contra], diff --git a/stubs/gevent/gevent/_fileobjectcommon.pyi b/stubs/gevent/gevent/_fileobjectcommon.pyi index 2dfdf1d78..727dd29a9 100644 --- a/stubs/gevent/gevent/_fileobjectcommon.pyi +++ b/stubs/gevent/gevent/_fileobjectcommon.pyi @@ -80,7 +80,9 @@ class OpenDescriptor(Generic[_IOT]): def buffer_size_for_stream(cls, stream: object) -> int: ... class FileObjectBase(Generic[_IOT, AnyStr]): - def __init__(self: FileObjectBase[_IOT, AnyStr], descriptor: OpenDescriptor[_IOT]) -> None: ... + def __init__( + self: FileObjectBase[_IOT, AnyStr], descriptor: OpenDescriptor[_IOT] # pyright: ignore[reportInvalidTypeVarUse] #11780 + ) -> None: ... io: _IOT @property def closed(self) -> bool: ... diff --git a/stubs/gevent/gevent/_util.pyi b/stubs/gevent/gevent/_util.pyi index b488f796d..f45283299 100644 --- a/stubs/gevent/gevent/_util.pyi +++ b/stubs/gevent/gevent/_util.pyi @@ -31,7 +31,9 @@ class Lazy(Generic[_T]): class readproperty(Generic[_T]): func: Callable[[Any], _T] - def __init__(self: readproperty[_T], func: Callable[[Any], _T]) -> None: ... + def __init__( + self: readproperty[_T], func: Callable[[Any], _T] # pyright: ignore[reportInvalidTypeVarUse] #11780 + ) -> None: ... @overload def __get__(self, inst: None, class_: type[object]) -> Self: ... @overload diff --git a/stubs/gevent/gevent/greenlet.pyi b/stubs/gevent/gevent/greenlet.pyi index efc5b2cff..bed83cfc3 100644 --- a/stubs/gevent/gevent/greenlet.pyi +++ b/stubs/gevent/gevent/greenlet.pyi @@ -19,7 +19,12 @@ class Greenlet(greenlet.greenlet, Generic[_P, _T]): kwargs: dict[str, Any] value: _T | None @overload - def __init__(self: Greenlet[_P, _T], run: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> None: ... + def __init__( + self: Greenlet[_P, _T], # pyright: ignore[reportInvalidTypeVarUse] #11780 + run: Callable[_P, _T], + *args: _P.args, + **kwargs: _P.kwargs, + ) -> None: ... @overload def __init__(self: Greenlet[[], None]) -> None: ... @readproperty diff --git a/stubs/libsass/sass.pyi b/stubs/libsass/sass.pyi index a95f96246..fac9d4820 100644 --- a/stubs/libsass/sass.pyi +++ b/stubs/libsass/sass.pyi @@ -160,15 +160,25 @@ class SassMap(Mapping[_KT, _VT_co]): @overload def __init__(self) -> None: ... @overload - def __init__(self: SassMap[str, _VT_co], **kwargs: _VT_co) -> None: ... + def __init__(self: SassMap[str, _VT_co], **kwargs: _VT_co) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 @overload def __init__(self, map: SupportsKeysAndGetItem[_KT, _VT_co], /) -> None: ... @overload - def __init__(self: SassMap[str, _VT_co], map: SupportsKeysAndGetItem[str, _VT_co], /, **kwargs: _VT_co) -> None: ... + def __init__( + self: SassMap[str, _VT_co], # pyright: ignore[reportInvalidTypeVarUse] #11780 + map: SupportsKeysAndGetItem[str, _VT_co], + /, + **kwargs: _VT_co, + ) -> None: ... @overload def __init__(self, iterable: Iterable[tuple[_KT, _VT_co]], /) -> None: ... @overload - def __init__(self: SassMap[str, _VT_co], iterable: Iterable[tuple[str, _VT_co]], /, **kwargs: _VT_co) -> None: ... + def __init__( + self: SassMap[str, _VT_co], # pyright: ignore[reportInvalidTypeVarUse] #11780 + iterable: Iterable[tuple[str, _VT_co]], + /, + **kwargs: _VT_co, + ) -> None: ... def __getitem__(self, key: _KT) -> _VT_co: ... def __iter__(self) -> Iterator[_KT]: ... def __len__(self) -> int: ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 65b3804a7..b0098457f 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -177,7 +177,7 @@ class _patch(Generic[_T]): kwargs: Mapping[str, Any] additional_patchers: Any def __init__( - self: _patch[_T], + self: _patch[_T], # pyright: ignore[reportInvalidTypeVarUse] #11780 getter: Callable[[], Any], attribute: str, new: _T, diff --git a/stubs/openpyxl/openpyxl/descriptors/base.pyi b/stubs/openpyxl/openpyxl/descriptors/base.pyi index e4ffe09fa..0bd080428 100644 --- a/stubs/openpyxl/openpyxl/descriptors/base.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/base.pyi @@ -36,7 +36,7 @@ class Typed(Descriptor[_T], Generic[_T, _N]): @overload def __init__( - self: Typed[_T, Literal[True]], + self: Typed[_T, Literal[True]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -45,7 +45,7 @@ class Typed(Descriptor[_T], Generic[_T, _N]): ) -> None: ... @overload def __init__( - self: Typed[_T, Literal[False]], + self: Typed[_T, Literal[False]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -64,7 +64,7 @@ class Typed(Descriptor[_T], Generic[_T, _N]): class Convertible(Typed[_T, _N]): @overload def __init__( - self: Convertible[_T, Literal[True]], + self: Convertible[_T, Literal[True]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -72,7 +72,7 @@ class Convertible(Typed[_T, _N]): ) -> None: ... @overload def __init__( - self: Convertible[_T, Literal[False]], + self: Convertible[_T, Literal[False]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], diff --git a/stubs/openpyxl/openpyxl/descriptors/nested.pyi b/stubs/openpyxl/openpyxl/descriptors/nested.pyi index 6a164ae5b..03727c2aa 100644 --- a/stubs/openpyxl/openpyxl/descriptors/nested.pyi +++ b/stubs/openpyxl/openpyxl/descriptors/nested.pyi @@ -25,7 +25,7 @@ class Nested(Descriptor[_T]): namespace: str | None # In usage, "Nested" is closed to "Typed" than "Descriptor", but doesn't use allow_none def __init__( - self: Nested[_T], + self: Nested[_T], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -44,7 +44,7 @@ class Nested(Descriptor[_T]): class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc] @overload def __init__( - self: NestedValue[_T, Literal[True]], + self: NestedValue[_T, Literal[True]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -52,7 +52,7 @@ class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc] ) -> None: ... @overload def __init__( - self: NestedValue[_T, Literal[False]], + self: NestedValue[_T, Literal[False]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -115,7 +115,7 @@ class NestedValue(Nested[_T], Convertible[_T, _N]): # type: ignore[misc] class NestedText(NestedValue[_T, _N]): @overload def __init__( - self: NestedText[_T, Literal[True]], + self: NestedText[_T, Literal[True]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], @@ -123,7 +123,7 @@ class NestedText(NestedValue[_T, _N]): ) -> None: ... @overload def __init__( - self: NestedText[_T, Literal[False]], + self: NestedText[_T, Literal[False]], # pyright: ignore[reportInvalidTypeVarUse] #11780 name: str | None = None, *, expected_type: _ExpectedTypeParam[_T], diff --git a/stubs/redis/redis/asyncio/connection.pyi b/stubs/redis/redis/asyncio/connection.pyi index e337975c0..1cc16e303 100644 --- a/stubs/redis/redis/asyncio/connection.pyi +++ b/stubs/redis/redis/asyncio/connection.pyi @@ -308,7 +308,7 @@ class ConnectionPool(Generic[_ConnectionT]): @overload def __init__( - self: ConnectionPool[_ConnectionT], + self: ConnectionPool[_ConnectionT], # pyright: ignore[reportInvalidTypeVarUse] #11780 connection_class: type[_ConnectionT], max_connections: int | None = None, # **kwargs are passed to the constructed connection instances. @@ -332,7 +332,7 @@ class BlockingConnectionPool(ConnectionPool[_ConnectionT]): @overload def __init__( - self: BlockingConnectionPool[_ConnectionT], + self: BlockingConnectionPool[_ConnectionT], # pyright: ignore[reportInvalidTypeVarUse] #11780 max_connections: int, timeout: int | None, connection_class: type[_ConnectionT], @@ -342,7 +342,7 @@ class BlockingConnectionPool(ConnectionPool[_ConnectionT]): ) -> None: ... @overload def __init__( - self: BlockingConnectionPool[_ConnectionT], + self: BlockingConnectionPool[_ConnectionT], # pyright: ignore[reportInvalidTypeVarUse] #11780 max_connections: int = 50, timeout: int | None = 20, *, diff --git a/stubs/uWSGI/uwsgidecorators.pyi b/stubs/uWSGI/uwsgidecorators.pyi index d344aea3b..34186a62d 100644 --- a/stubs/uWSGI/uwsgidecorators.pyi +++ b/stubs/uWSGI/uwsgidecorators.pyi @@ -26,7 +26,7 @@ class postfork(Generic[_P, _T]): @overload def __init__(self: postfork[..., Any], f: int) -> None: ... @overload - def __init__(self: postfork[_P, _T], f: Callable[_P, _T]) -> None: ... + def __init__(self: postfork[_P, _T], f: Callable[_P, _T]) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 @overload def __call__(self, f: Callable[_P2, _T2], /) -> postfork[_P2, _T2]: ... @overload @@ -70,7 +70,7 @@ class mulefunc(Generic[_P, _T]): @overload def __init__(self: mulefunc[..., Any], f: int) -> None: ... @overload - def __init__(self: mulefunc[_P, _T], f: Callable[_P, _T]) -> None: ... + def __init__(self: mulefunc[_P, _T], f: Callable[_P, _T]) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780 def real_call(self, *args: _P.args, **kwargs: _P.kwargs) -> None: ... @overload def __call__(self, f: Callable[_P2, _T2], /) -> mulefunc[_P2, _T2]: ...