From b0035fe7f54985e5a44431c611062b34db26561e Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 9 Mar 2024 15:02:45 -0800 Subject: [PATCH 1/3] codemod --- stubs/Deprecated/deprecated/classic.pyi | 2 +- stubs/ExifRead/exifread/_types.pyi | 4 +- .../flask_socketio/__init__.pyi | 2 +- stubs/Markdown/markdown/core.pyi | 8 +- stubs/Pillow/PIL/Image.pyi | 2 +- stubs/Pillow/PIL/ImageFont.pyi | 2 +- stubs/Pillow/PIL/ImageOps.pyi | 2 +- stubs/Pillow/PIL/_imaging.pyi | 12 +- stubs/PyYAML/yaml/emitter.pyi | 2 +- stubs/WTForms/wtforms/fields/core.pyi | 2 +- stubs/WTForms/wtforms/form.pyi | 4 +- stubs/WTForms/wtforms/i18n.pyi | 4 +- stubs/WTForms/wtforms/meta.pyi | 10 +- stubs/WebOb/webob/acceptparse.pyi | 68 ++--- stubs/WebOb/webob/cookies.pyi | 4 +- stubs/WebOb/webob/dec.pyi | 4 +- stubs/WebOb/webob/descriptors.pyi | 8 +- stubs/WebOb/webob/etag.pyi | 10 +- stubs/WebOb/webob/multidict.pyi | 6 +- .../aiofiles/aiofiles/tempfile/temptypes.pyi | 6 +- stubs/aiofiles/aiofiles/threadpool/binary.pyi | 24 +- stubs/aiofiles/aiofiles/threadpool/text.pyi | 14 +- stubs/bleach/bleach/callbacks.pyi | 2 +- stubs/cffi/_cffi_backend.pyi | 94 +++---- .../click-spinner/click_spinner/__init__.pyi | 2 +- stubs/colorama/colorama/ansitowin32.pyi | 2 +- .../docutils/docutils/languages/__init__.pyi | 2 +- stubs/docutils/docutils/nodes.pyi | 4 +- .../docutils/docutils/transforms/__init__.pyi | 4 +- stubs/fpdf2/fpdf/encryption.pyi | 2 +- stubs/gdb/gdb/__init__.pyi | 50 ++-- stubs/gdb/gdb/events.pyi | 52 ++-- stubs/gdb/gdb/types.pyi | 2 +- stubs/gevent/gevent/_abstract_linkable.pyi | 4 +- stubs/gevent/gevent/_fileobjectcommon.pyi | 6 +- stubs/gevent/gevent/_hub_primitives.pyi | 4 +- stubs/gevent/gevent/_monitor.pyi | 2 +- stubs/gevent/gevent/_types.pyi | 2 +- stubs/gevent/gevent/_waiter.pyi | 6 +- stubs/gevent/gevent/baseserver.pyi | 4 +- stubs/gevent/gevent/events.pyi | 2 +- stubs/gevent/gevent/greenlet.pyi | 2 +- stubs/gevent/gevent/pool.pyi | 2 +- stubs/gevent/gevent/pywsgi.pyi | 2 +- stubs/gevent/gevent/server.pyi | 4 +- stubs/greenlet/greenlet/_greenlet.pyi | 14 +- stubs/ibm-db/ibm_db.pyi | 220 +++++++-------- stubs/jsonschema/jsonschema/_utils.pyi | 2 +- stubs/libsass/sass.pyi | 8 +- stubs/mock/mock/mock.pyi | 6 +- stubs/mypy-extensions/mypy_extensions.pyi | 12 +- stubs/mysqlclient/MySQLdb/_mysql.pyi | 8 +- stubs/netaddr/netaddr/ip/iana.pyi | 2 +- stubs/openpyxl/openpyxl/__init__.pyi | 2 +- stubs/openpyxl/openpyxl/cell/rich_text.pyi | 2 +- stubs/openpyxl/openpyxl/compat/singleton.pyi | 8 +- stubs/openpyxl/openpyxl/worksheet/_writer.pyi | 2 +- .../openpyxl/xml/_functions_overloads.pyi | 8 +- stubs/paramiko/paramiko/client.pyi | 4 +- stubs/peewee/peewee.pyi | 6 +- stubs/pexpect/pexpect/spawnbase.pyi | 2 +- stubs/protobuf/google/protobuf/reflection.pyi | 2 +- stubs/psutil/psutil/_psutil_linux.pyi | 2 +- stubs/psutil/psutil/_psutil_osx.pyi | 2 +- stubs/psutil/psutil/_psutil_windows.pyi | 2 +- stubs/psycopg2/psycopg2/_psycopg.pyi | 138 +++++----- stubs/pyOpenSSL/OpenSSL/SSL.pyi | 2 +- stubs/pycurl/pycurl.pyi | 4 +- stubs/pyfarmhash/farmhash.pyi | 18 +- .../PyInstaller/utils/win32/versioninfo.pyi | 2 +- stubs/pyserial/serial/rfc2217.pyi | 2 +- stubs/pyserial/serial/serialcli.pyi | 2 +- stubs/pyserial/serial/serialjava.pyi | 2 +- stubs/pyserial/serial/serialposix.pyi | 2 +- stubs/pyserial/serial/serialutil.pyi | 6 +- stubs/pyserial/serial/serialwin32.pyi | 2 +- stubs/pyserial/serial/threaded/__init__.pyi | 4 +- .../serial/urlhandler/protocol_cp2110.pyi | 2 +- .../serial/urlhandler/protocol_loop.pyi | 2 +- .../serial/urlhandler/protocol_socket.pyi | 2 +- stubs/python-dateutil/dateutil/tz/tz.pyi | 4 +- stubs/python-xlib/Xlib/protocol/rq.pyi | 4 +- stubs/redis/redis/cluster.pyi | 2 +- stubs/regex/regex/regex.pyi | 38 +-- .../requests_oauthlib/oauth2_session.pyi | 8 +- stubs/requests/requests/structures.pyi | 2 +- stubs/seaborn/seaborn/_core/plot.pyi | 4 +- stubs/six/six/__init__.pyi | 4 +- stubs/tensorflow/tensorflow/data/__init__.pyi | 10 +- .../tensorflow/keras/constraints.pyi | 2 +- stubs/tensorflow/tensorflow/keras/layers.pyi | 8 +- .../tensorflow/keras/regularizers.pyi | 2 +- stubs/tree-sitter/tree_sitter/binding.pyi | 10 +- stubs/uWSGI/uwsgi.pyi | 254 +++++++++--------- stubs/uWSGI/uwsgidecorators.pyi | 4 +- stubs/wurlitzer/wurlitzer.pyi | 2 +- stubs/zstd/zstd.pyi | 14 +- 97 files changed, 666 insertions(+), 666 deletions(-) diff --git a/stubs/Deprecated/deprecated/classic.pyi b/stubs/Deprecated/deprecated/classic.pyi index f2e60e4f4251..d5b794ad9ed7 100644 --- a/stubs/Deprecated/deprecated/classic.pyi +++ b/stubs/Deprecated/deprecated/classic.pyi @@ -19,7 +19,7 @@ class ClassicAdapter: def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ... @overload -def deprecated(__wrapped: _F) -> _F: ... +def deprecated(wrapped: _F, /) -> _F: ... @overload def deprecated( reason: str = ..., *, version: str = ..., action: _Actions | None = ..., category: type[Warning] | None = ... diff --git a/stubs/ExifRead/exifread/_types.pyi b/stubs/ExifRead/exifread/_types.pyi index 78c39be17cb5..9f2d37827cc6 100644 --- a/stubs/ExifRead/exifread/_types.pyi +++ b/stubs/ExifRead/exifread/_types.pyi @@ -9,6 +9,6 @@ TagDict: TypeAlias = dict[int, tuple[str] | tuple[str, Any]] class Reader(Protocol): def __iter__(self) -> bytes: ... - def read(self, __size: int) -> bytes: ... + def read(self, size: int, /) -> bytes: ... def tell(self) -> int: ... - def seek(self, __offset: int, __whence: Literal[0, 1] = ...) -> object: ... + def seek(self, offset: int, whence: Literal[0, 1] = ..., /) -> object: ... diff --git a/stubs/Flask-SocketIO/flask_socketio/__init__.pyi b/stubs/Flask-SocketIO/flask_socketio/__init__.pyi index 093762f3be8d..ca444323b87a 100644 --- a/stubs/Flask-SocketIO/flask_socketio/__init__.pyi +++ b/stubs/Flask-SocketIO/flask_socketio/__init__.pyi @@ -54,7 +54,7 @@ class SocketIO: def on_error_default(self, exception_handler: _ExceptionHandler[_R_co]) -> _ExceptionHandler[_R_co]: ... def on_event(self, message: str, handler: _Handler[[Incomplete], object], namespace: str | None = None) -> None: ... @overload - def event(self, __event_handler: _Handler[_P, _R_co]) -> _Handler[_P, _R_co]: ... + def event(self, event_handler: _Handler[_P, _R_co], /) -> _Handler[_P, _R_co]: ... @overload def event(self, namespace: str | None = None, *args, **kwargs) -> _HandlerDecorator: ... def on_namespace(self, namespace_handler: Namespace) -> None: ... diff --git a/stubs/Markdown/markdown/core.pyi b/stubs/Markdown/markdown/core.pyi index 7c5e77f586e8..cc0cb34ce5a1 100644 --- a/stubs/Markdown/markdown/core.pyi +++ b/stubs/Markdown/markdown/core.pyi @@ -10,13 +10,13 @@ from .util import HtmlStash, Registry # TODO: The following protocols can be replaced by their counterparts from # codecs, once they have been propagated to all type checkers. class _WritableStream(Protocol): - def write(self, __data: bytes) -> object: ... - def seek(self, __offset: int, __whence: int) -> object: ... + def write(self, data: bytes, /) -> object: ... + def seek(self, offset: int, whence: int, /) -> object: ... def close(self) -> object: ... class _ReadableStream(Protocol): - def read(self, __size: int = ...) -> bytes: ... - def seek(self, __offset: int, __whence: int) -> object: ... + def read(self, size: int = ..., /) -> bytes: ... + def seek(self, offset: int, whence: int, /) -> object: ... def close(self) -> object: ... class Markdown: diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index 18fb5c63cbd6..d8d376a0a6ca 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -34,7 +34,7 @@ _Color: TypeAlias = ( ) class _Writeable(SupportsWrite[bytes], Protocol): - def seek(self, __offset: int) -> Any: ... + def seek(self, offset: int, /) -> Any: ... # Ref: https://numpy.org/doc/stable/reference/arrays.interface.html#python-side class _SupportsArrayInterface(Protocol): diff --git a/stubs/Pillow/PIL/ImageFont.pyi b/stubs/Pillow/PIL/ImageFont.pyi index 2dd4008b7712..94d6ecf262e9 100644 --- a/stubs/Pillow/PIL/ImageFont.pyi +++ b/stubs/Pillow/PIL/ImageFont.pyi @@ -12,7 +12,7 @@ class Layout(IntEnum): MAX_STRING_LENGTH: Final[int] = 1_000_000 class _Font(Protocol): - def getmask(self, __text: str | bytes, __mode: str = ..., direction=..., features=...): ... + def getmask(self, text: str | bytes, mode: str = ..., /, direction=..., features=...): ... class ImageFont: def getmask(self, text: str | bytes, mode: str = "", direction=..., features=...): ... diff --git a/stubs/Pillow/PIL/ImageOps.pyi b/stubs/Pillow/PIL/ImageOps.pyi index f51f1e888236..098bdb1af204 100644 --- a/stubs/Pillow/PIL/ImageOps.pyi +++ b/stubs/Pillow/PIL/ImageOps.pyi @@ -9,7 +9,7 @@ from .ImageColor import _Ink _Border: TypeAlias = int | tuple[int, int] | tuple[int, int, int, int] class _Deformer(Protocol): - def getmesh(self, __image: Image): ... + def getmesh(self, image: Image, /): ... def autocontrast( image: Image, diff --git a/stubs/Pillow/PIL/_imaging.pyi b/stubs/Pillow/PIL/_imaging.pyi index 669d5a4f8c47..0224d6b3ebf4 100644 --- a/stubs/Pillow/PIL/_imaging.pyi +++ b/stubs/Pillow/PIL/_imaging.pyi @@ -17,13 +17,13 @@ class _PixelAccessor(Protocol): # noqa: Y046 # # This protocol describes that interface. # TODO: should the color args and getter return types be _Color? - def __setitem__(self, __xy: tuple[int, int], __color: Incomplete) -> None: ... - def __getitem__(self, __xy: tuple[int, int]) -> Incomplete: ... - def putpixel(self, __xy: tuple[int, int], __color: Incomplete) -> None: ... - def getpixel(self, __xy: tuple[int, int]) -> Incomplete: ... + def __setitem__(self, xy: tuple[int, int], color: Incomplete, /) -> None: ... + def __getitem__(self, xy: tuple[int, int], /) -> Incomplete: ... + def putpixel(self, xy: tuple[int, int], color: Incomplete, /) -> None: ... + def getpixel(self, xy: tuple[int, int], /) -> Incomplete: ... class _Path: def __getattr__(self, item: str) -> Incomplete: ... -def path(__x: Sequence[tuple[float, float]] | Sequence[float]) -> _Path: ... -def __getattr__(__name: str) -> Incomplete: ... +def path(x: Sequence[tuple[float, float]] | Sequence[float], /) -> _Path: ... +def __getattr__(name: str, /) -> Incomplete: ... diff --git a/stubs/PyYAML/yaml/emitter.pyi b/stubs/PyYAML/yaml/emitter.pyi index 62fd9d07a573..ee8f9403b616 100644 --- a/stubs/PyYAML/yaml/emitter.pyi +++ b/stubs/PyYAML/yaml/emitter.pyi @@ -8,7 +8,7 @@ from .events import Event _T_contra = TypeVar("_T_contra", str, bytes, contravariant=True) class _WriteStream(Protocol[_T_contra]): - def write(self, __data: _T_contra) -> object: ... + def write(self, data: _T_contra, /) -> object: ... # Optional fields: # encoding: str # def flush(self) -> object: ... diff --git a/stubs/WTForms/wtforms/fields/core.pyi b/stubs/WTForms/wtforms/fields/core.pyi index 79f69e2d0542..c0972d0ca399 100644 --- a/stubs/WTForms/wtforms/fields/core.pyi +++ b/stubs/WTForms/wtforms/fields/core.pyi @@ -17,7 +17,7 @@ _FieldT_contra = TypeVar("_FieldT_contra", bound=Field, contravariant=True) _Filter: TypeAlias = Callable[[Any], Any] class _Validator(Protocol[_FormT_contra, _FieldT_contra]): - def __call__(self, __form: _FormT_contra, __field: _FieldT_contra) -> object: ... + def __call__(self, form: _FormT_contra, field: _FieldT_contra, /) -> object: ... class _Widget(Protocol[_FieldT_contra]): def __call__(self, field: _FieldT_contra, **kwargs: Any) -> Markup: ... diff --git a/stubs/WTForms/wtforms/form.pyi b/stubs/WTForms/wtforms/form.pyi index 6d1ff0c5bc2d..e1830661193f 100644 --- a/stubs/WTForms/wtforms/form.pyi +++ b/stubs/WTForms/wtforms/form.pyi @@ -13,9 +13,9 @@ _FormErrors: TypeAlias = dict[str | None, Sequence[str] | _FormErrors] # not instantianted after a new field had been added/removed class _UnboundFields(Protocol): @overload - def __get__(self, __obj: None, __owner: type[object] | None = None) -> list[tuple[str, UnboundField[Any]]] | None: ... + def __get__(self, obj: None, owner: type[object] | None = None, /) -> list[tuple[str, UnboundField[Any]]] | None: ... @overload - def __get__(self, __obj: object, __owner: type[object] | None = None) -> list[tuple[str, UnboundField[Any]]]: ... + def __get__(self, obj: object, owner: type[object] | None = None, /) -> list[tuple[str, UnboundField[Any]]]: ... class BaseForm: meta: DefaultMeta diff --git a/stubs/WTForms/wtforms/i18n.pyi b/stubs/WTForms/wtforms/i18n.pyi index 39cd5f697464..a0f5e237e20e 100644 --- a/stubs/WTForms/wtforms/i18n.pyi +++ b/stubs/WTForms/wtforms/i18n.pyi @@ -5,8 +5,8 @@ from typing import Protocol, TypeVar, overload _T = TypeVar("_T") class _SupportsUgettextAndUngettext(Protocol): - def ugettext(self, __string: str) -> str: ... - def ungettext(self, __singular: str, __plural: str, __n: int) -> str: ... + def ugettext(self, string: str, /) -> str: ... + def ungettext(self, singular: str, plural: str, n: int, /) -> str: ... def messages_path() -> str: ... def get_builtin_gnu_translations(languages: Iterable[str] | None = None) -> GNUTranslations: ... diff --git a/stubs/WTForms/wtforms/meta.pyi b/stubs/WTForms/wtforms/meta.pyi index a821e8a9a129..83181cab93f2 100644 --- a/stubs/WTForms/wtforms/meta.pyi +++ b/stubs/WTForms/wtforms/meta.pyi @@ -10,8 +10,8 @@ from wtforms.form import BaseForm _FieldT = TypeVar("_FieldT", bound=Field) class _SupportsGettextAndNgettext(Protocol): - def gettext(self, __string: str) -> str: ... - def ngettext(self, __singular: str, __plural: str, __n: int) -> str: ... + def gettext(self, string: str, /) -> str: ... + def ngettext(self, singular: str, plural: str, n: int, /) -> str: ... # these are the methods WTForms depends on, the dict can either provide # a getlist or getall, if it only provides getall, it will wrapped, to @@ -19,16 +19,16 @@ class _SupportsGettextAndNgettext(Protocol): class _MultiDictLikeBase(Protocol): def __iter__(self) -> Iterator[str]: ... def __len__(self) -> int: ... - def __contains__(self, __key: Any) -> bool: ... + def __contains__(self, key: Any, /) -> bool: ... # since how file uploads are represented in formdata is implementation-specific # we have to be generous in what we accept in the return of getlist/getall # we can make this generic if we ever want to be more specific class _MultiDictLikeWithGetlist(_MultiDictLikeBase, Protocol): - def getlist(self, __key: str) -> list[Any]: ... + def getlist(self, key: str, /) -> list[Any]: ... class _MultiDictLikeWithGetall(_MultiDictLikeBase, Protocol): - def getall(self, __key: str) -> list[Any]: ... + def getall(self, key: str, /) -> list[Any]: ... _MultiDictLike: TypeAlias = _MultiDictLikeWithGetall | _MultiDictLikeWithGetlist diff --git a/stubs/WebOb/webob/acceptparse.pyi b/stubs/WebOb/webob/acceptparse.pyi index 04c711429a09..a7d0d01f14ea 100644 --- a/stubs/WebOb/webob/acceptparse.pyi +++ b/stubs/WebOb/webob/acceptparse.pyi @@ -110,18 +110,18 @@ def create_accept_header(header_value: str) -> AcceptValidHeader | AcceptInvalid class _AcceptProperty: @overload - def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload - def __get__(self, __obj: Any, __type: type | None = ...) -> AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader: ... + def __get__(self, obj: Any, type: type | None = ..., /) -> AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader: ... @overload - def __set__(self, __obj: Any, __value: str | None) -> None: ... + def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload - def __set__(self, __obj: Any, __value: AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader) -> None: ... + def __set__(self, obj: Any, value: AcceptNoHeader | AcceptValidHeader | AcceptInvalidHeader, /) -> None: ... @overload - def __set__(self, __obj: Any, __value: SupportsItems[str, float | tuple[float, str]]) -> None: ... + def __set__(self, obj: Any, value: SupportsItems[str, float | tuple[float, str]], /) -> None: ... @overload - def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float, str] | list[Any]]) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __set__(self, obj: Any, value: _ListOrTuple[str | tuple[str, float, str] | list[Any]], /) -> None: ... + def __delete__(self, obj: Any, /) -> None: ... def accept_property() -> _AcceptProperty: ... @@ -221,22 +221,22 @@ def create_accept_charset_header(header_value: str) -> AcceptCharsetValidHeader class _AcceptCharsetProperty: @overload - def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload def __get__( - self, __obj: Any, __type: type | None = ... - ) -> AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader: ... + self, obj: Any, type: type | None = ..., + /) -> AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader: ... @overload - def __set__(self, __obj: Any, __value: str | None) -> None: ... + def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload def __set__( - self, __obj: Any, __value: AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader - ) -> None: ... + self, obj: Any, value: AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader, + /) -> None: ... @overload - def __set__(self, __obj: Any, __value: SupportsItems[str, float]) -> None: ... + def __set__(self, obj: Any, value: SupportsItems[str, float], /) -> None: ... @overload - def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __set__(self, obj: Any, value: _ListOrTuple[str | tuple[str, float] | list[Any]], /) -> None: ... + def __delete__(self, obj: Any, /) -> None: ... def accept_charset_property() -> _AcceptCharsetProperty: ... @@ -336,22 +336,22 @@ def create_accept_encoding_header(header_value: str) -> AcceptEncodingValidHeade class _AcceptEncodingProperty: @overload - def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload def __get__( - self, __obj: Any, __type: type | None = ... - ) -> AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader: ... + self, obj: Any, type: type | None = ..., + /) -> AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader: ... @overload - def __set__(self, __obj: Any, __value: str | None) -> None: ... + def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload def __set__( - self, __obj: Any, __value: AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader - ) -> None: ... + self, obj: Any, value: AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader, + /) -> None: ... @overload - def __set__(self, __obj: Any, __value: SupportsItems[str, float]) -> None: ... + def __set__(self, obj: Any, value: SupportsItems[str, float], /) -> None: ... @overload - def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __set__(self, obj: Any, value: _ListOrTuple[str | tuple[str, float] | list[Any]], /) -> None: ... + def __delete__(self, obj: Any, /) -> None: ... def accept_encoding_property() -> _AcceptEncodingProperty: ... @@ -483,21 +483,21 @@ def create_accept_language_header(header_value: str) -> AcceptLanguageValidHeade class _AcceptLanguageProperty: @overload - def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload def __get__( - self, __obj: Any, __type: type | None = ... - ) -> AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader: ... + self, obj: Any, type: type | None = ..., + /) -> AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader: ... @overload - def __set__(self, __obj: Any, __value: str | None) -> None: ... + def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload def __set__( - self, __obj: Any, __value: AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader - ) -> None: ... + self, obj: Any, value: AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader, + /) -> None: ... @overload - def __set__(self, __obj: Any, __value: SupportsItems[str, float]) -> None: ... + def __set__(self, obj: Any, value: SupportsItems[str, float], /) -> None: ... @overload - def __set__(self, __obj: Any, __value: _ListOrTuple[str | tuple[str, float] | list[Any]]) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __set__(self, obj: Any, value: _ListOrTuple[str | tuple[str, float] | list[Any]], /) -> None: ... + def __delete__(self, obj: Any, /) -> None: ... def accept_language_property() -> _AcceptLanguageProperty: ... diff --git a/stubs/WebOb/webob/cookies.pyi b/stubs/WebOb/webob/cookies.pyi index 2ee0ce964545..fa6d349e98b6 100644 --- a/stubs/WebOb/webob/cookies.pyi +++ b/stubs/WebOb/webob/cookies.pyi @@ -17,8 +17,8 @@ _T = TypeVar("_T") _SameSitePolicy: TypeAlias = Literal["Strict", "Lax", "None", "strict", "lax", "none"] class _Serializer(Protocol): - def loads(self, __appstruct: Any) -> bytes: ... - def dumps(self, __bstruct: bytes) -> Any: ... + def loads(self, appstruct: Any, /) -> bytes: ... + def dumps(self, bstruct: bytes, /) -> Any: ... class RequestCookies(MutableMapping[str, str]): def __init__(self, environ: WSGIEnvironment) -> None: ... diff --git a/stubs/WebOb/webob/dec.pyi b/stubs/WebOb/webob/dec.pyi index e9eb600490c3..5379a4f02e48 100644 --- a/stubs/WebOb/webob/dec.pyi +++ b/stubs/WebOb/webob/dec.pyi @@ -151,9 +151,9 @@ class _unbound_wsgify(wsgify[_RequestT_contra, _P], Generic[_RequestT_contra, _P @overload def __call__(self, __self: _S, func: _RequestHandler[_RequestT_contra, _P], /) -> Self: ... @overload - def __call__(self, __self: _S, req: _RequestT_contra) -> _AnyResponse: ... + def __call__(self, self: _S, /, req: _RequestT_contra) -> _AnyResponse: ... @overload - def __call__(self, __self: _S, req: _RequestT_contra, *args: _P.args, **kw: _P.kwargs) -> _AnyResponse: ... + def __call__(self, self: _S, /, req: _RequestT_contra, *args: _P.args, **kw: _P.kwargs) -> _AnyResponse: ... class _UnboundMiddleware(Generic[_RequestT_contra, _AppT_contra, _P]): wrapper_class: type[wsgify[_RequestT_contra, Concatenate[_AppT_contra, _P]]] diff --git a/stubs/WebOb/webob/descriptors.pyi b/stubs/WebOb/webob/descriptors.pyi index d76b5679165d..a80e04287f14 100644 --- a/stubs/WebOb/webob/descriptors.pyi +++ b/stubs/WebOb/webob/descriptors.pyi @@ -28,13 +28,13 @@ _ContentRangeParams: TypeAlias = ( class _AsymmetricProperty(Generic[_GetterReturnType, _SetterValueType]): @overload - def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload - def __get__(self, __obj: Any, __type: type | None = ...) -> _GetterReturnType: ... - def __set__(self, __obj: Any, __value: _SetterValueType) -> None: ... + def __get__(self, obj: Any, type: type | None = ..., /) -> _GetterReturnType: ... + def __set__(self, obj: Any, value: _SetterValueType, /) -> None: ... class _AsymmetricPropertyWithDelete(_AsymmetricProperty[_GetterReturnType, _SetterValueType]): - def __delete__(self, __obj: Any) -> None: ... + def __delete__(self, obj: Any, /) -> None: ... class _SymmetricProperty(_AsymmetricProperty[_T, _T]): ... class _SymmetricPropertyWithDelete(_AsymmetricPropertyWithDelete[_T, _T]): ... diff --git a/stubs/WebOb/webob/etag.pyi b/stubs/WebOb/webob/etag.pyi index 800570393c92..08a81da59770 100644 --- a/stubs/WebOb/webob/etag.pyi +++ b/stubs/WebOb/webob/etag.pyi @@ -9,14 +9,14 @@ _ETag: TypeAlias = _AnyETag | _NoETag | ETagMatcher class _ETagProperty: @overload - def __get__(self, __obj: None, __type: type | None = ...) -> property: ... + def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload - def __get__(self, __obj: Any, __type: type | None = ...) -> _ETag: ... + def __get__(self, obj: Any, type: type | None = ..., /) -> _ETag: ... @overload - def __set__(self, __obj: Any, __value: str | None) -> None: ... + def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload - def __set__(self, __obj: Any, __value: _ETag) -> None: ... - def __delete__(self, __obj: Any) -> None: ... + def __set__(self, obj: Any, value: _ETag, /) -> None: ... + def __delete__(self, obj: Any, /) -> None: ... def etag_property(key: str, default: _ETag, rfc_section: str, strong: bool = True) -> _ETagProperty: ... diff --git a/stubs/WebOb/webob/multidict.pyi b/stubs/WebOb/webob/multidict.pyi index c8470952d5be..75a58d1077ea 100644 --- a/stubs/WebOb/webob/multidict.pyi +++ b/stubs/WebOb/webob/multidict.pyi @@ -11,9 +11,9 @@ _VT = TypeVar("_VT") class MultiDict(MutableMapping[_KT, _VT]): @overload - def __init__(self, __m: SupportsItems[_KT, _VT], **kwargs: _VT) -> None: ... + def __init__(self, m: SupportsItems[_KT, _VT], /, **kwargs: _VT) -> None: ... @overload - def __init__(self, __m: Iterable[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def __init__(self, m: Iterable[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ... @overload def __init__(self, **kwargs: _VT) -> None: ... @classmethod @@ -46,7 +46,7 @@ class MultiDict(MutableMapping[_KT, _VT]): def pop(self, key: _KT, default: _T) -> _VT | _T: ... def popitem(self) -> tuple[_KT, _VT]: ... @overload # type: ignore[override] - def update(self, __m: Collection[tuple[_KT, _VT]], **kwargs: _VT) -> None: ... + def update(self, m: Collection[tuple[_KT, _VT]], /, **kwargs: _VT) -> None: ... @overload def update(self, **kwargs: _VT) -> None: ... @overload diff --git a/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi b/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi index 707d2ec66483..0e53e19be4cc 100644 --- a/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi +++ b/stubs/aiofiles/aiofiles/tempfile/temptypes.pyi @@ -20,9 +20,9 @@ class AsyncSpooledTemporaryFile(AsyncBase[_T]): async def flush(self) -> None: ... async def isatty(self) -> bool: ... # All must return `AnyStr`: - async def read(self, __n: int = ...) -> Incomplete: ... - async def readline(self, __limit: int | None = ...) -> Incomplete: ... - async def readlines(self, __hint: int = ...) -> list[Incomplete]: ... + async def read(self, n: int = ..., /) -> Incomplete: ... + async def readline(self, limit: int | None = ..., /) -> Incomplete: ... + async def readlines(self, hint: int = ..., /) -> list[Incomplete]: ... # --- async def seek(self, offset: int, whence: int = ...) -> int: ... async def tell(self) -> int: ... diff --git a/stubs/aiofiles/aiofiles/threadpool/binary.pyi b/stubs/aiofiles/aiofiles/threadpool/binary.pyi index db6b633157e3..d10f98f2a242 100644 --- a/stubs/aiofiles/aiofiles/threadpool/binary.pyi +++ b/stubs/aiofiles/aiofiles/threadpool/binary.pyi @@ -10,17 +10,17 @@ class _UnknownAsyncBinaryIO(AsyncBase[bytes]): async def close(self) -> None: ... async def flush(self) -> None: ... async def isatty(self) -> bool: ... - async def read(self, __size: int = ...) -> bytes: ... - async def readinto(self, __buffer: WriteableBuffer) -> int | None: ... - async def readline(self, __size: int | None = ...) -> bytes: ... - async def readlines(self, __hint: int = ...) -> list[bytes]: ... - async def seek(self, __offset: int, __whence: int = ...) -> int: ... + async def read(self, size: int = ..., /) -> bytes: ... + async def readinto(self, buffer: WriteableBuffer, /) -> int | None: ... + async def readline(self, size: int | None = ..., /) -> bytes: ... + async def readlines(self, hint: int = ..., /) -> list[bytes]: ... + async def seek(self, offset: int, whence: int = ..., /) -> int: ... async def seekable(self) -> bool: ... async def tell(self) -> int: ... - async def truncate(self, __size: int | None = ...) -> int: ... + async def truncate(self, size: int | None = ..., /) -> int: ... async def writable(self) -> bool: ... - async def write(self, __b: ReadableBuffer) -> int: ... - async def writelines(self, __lines: Iterable[ReadableBuffer]) -> None: ... + async def write(self, b: ReadableBuffer, /) -> int: ... + async def writelines(self, lines: Iterable[ReadableBuffer], /) -> None: ... def fileno(self) -> int: ... def readable(self) -> bool: ... @property @@ -31,22 +31,22 @@ class _UnknownAsyncBinaryIO(AsyncBase[bytes]): def name(self) -> FileDescriptorOrPath: ... class AsyncBufferedIOBase(_UnknownAsyncBinaryIO): - async def read1(self, __size: int = ...) -> bytes: ... + async def read1(self, size: int = ..., /) -> bytes: ... def detach(self) -> FileIO: ... @property def raw(self) -> FileIO: ... class AsyncIndirectBufferedIOBase(AsyncIndirectBase[bytes], _UnknownAsyncBinaryIO): - async def read1(self, __size: int = ...) -> bytes: ... + async def read1(self, size: int = ..., /) -> bytes: ... def detach(self) -> FileIO: ... @property def raw(self) -> FileIO: ... class AsyncBufferedReader(AsyncBufferedIOBase): - async def peek(self, __size: int = ...) -> bytes: ... + async def peek(self, size: int = ..., /) -> bytes: ... class AsyncIndirectBufferedReader(AsyncIndirectBufferedIOBase): - async def peek(self, __size: int = ...) -> bytes: ... + async def peek(self, size: int = ..., /) -> bytes: ... class AsyncFileIO(_UnknownAsyncBinaryIO): async def readall(self) -> bytes: ... diff --git a/stubs/aiofiles/aiofiles/threadpool/text.pyi b/stubs/aiofiles/aiofiles/threadpool/text.pyi index 3e354d62b44d..6003a0852c31 100644 --- a/stubs/aiofiles/aiofiles/threadpool/text.pyi +++ b/stubs/aiofiles/aiofiles/threadpool/text.pyi @@ -8,16 +8,16 @@ class _UnknownAsyncTextIO(AsyncBase[str]): async def close(self) -> None: ... async def flush(self) -> None: ... async def isatty(self) -> bool: ... - async def read(self, __size: int | None = ...) -> str: ... - async def readline(self, __size: int = ...) -> str: ... - async def readlines(self, __hint: int = ...) -> list[str]: ... - async def seek(self, __offset: int, __whence: int = ...) -> int: ... + async def read(self, size: int | None = ..., /) -> str: ... + async def readline(self, size: int = ..., /) -> str: ... + async def readlines(self, hint: int = ..., /) -> list[str]: ... + async def seek(self, offset: int, whence: int = ..., /) -> int: ... async def seekable(self) -> bool: ... async def tell(self) -> int: ... - async def truncate(self, __size: int | None = ...) -> int: ... + async def truncate(self, size: int | None = ..., /) -> int: ... async def writable(self) -> bool: ... - async def write(self, __b: str) -> int: ... - async def writelines(self, __lines: Iterable[str]) -> None: ... + async def write(self, b: str, /) -> int: ... + async def writelines(self, lines: Iterable[str], /) -> None: ... def detach(self) -> BinaryIO: ... def fileno(self) -> int: ... def readable(self) -> bool: ... diff --git a/stubs/bleach/bleach/callbacks.pyi b/stubs/bleach/bleach/callbacks.pyi index ff632caf0ca7..5e497cc70328 100644 --- a/stubs/bleach/bleach/callbacks.pyi +++ b/stubs/bleach/bleach/callbacks.pyi @@ -7,7 +7,7 @@ from bleach import _HTMLAttrKey _HTMLAttrs: TypeAlias = MutableMapping[_HTMLAttrKey, str] class _Callback(Protocol): # noqa: Y046 - def __call__(self, __attrs: _HTMLAttrs, __new: bool = ...) -> _HTMLAttrs: ... + def __call__(self, attrs: _HTMLAttrs, new: bool = ..., /) -> _HTMLAttrs: ... def nofollow(attrs: _HTMLAttrs, new: bool = False) -> _HTMLAttrs: ... def target_blank(attrs: _HTMLAttrs, new: bool = False) -> _HTMLAttrs: ... diff --git a/stubs/cffi/_cffi_backend.pyi b/stubs/cffi/_cffi_backend.pyi index 300da7c9f57c..ed1f0fcb6e8d 100644 --- a/stubs/cffi/_cffi_backend.pyi +++ b/stubs/cffi/_cffi_backend.pyi @@ -137,10 +137,10 @@ class FFI: _includes: tuple[FFI, ...] = ..., ) -> None: ... @overload - def addressof(self, __cdata: CData, *field_or_index: str | int) -> CData: ... + def addressof(self, cdata: CData, /, *field_or_index: str | int) -> CData: ... @overload - def addressof(self, __library: Lib, __name: str) -> CData: ... - def alignof(self, __cdecl: str | CType | CData) -> int: ... + def addressof(self, library: Lib, name: str, /) -> CData: ... + def alignof(self, cdecl: str | CType | CData, /) -> int: ... @overload def callback( self, @@ -161,11 +161,11 @@ class FFI: def def_extern( self, name: str = ..., error: Any = ..., onerror: Callable[[Exception, Any, types.TracebackType], Any] = ... ) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ... - def dlclose(self, __lib: Lib) -> None: ... + def dlclose(self, lib: Lib, /) -> None: ... if sys.platform == "win32": - def dlopen(self, __libpath: str | CData, __flags: int = ...) -> Lib: ... + def dlopen(self, libpath: str | CData, flags: int = ..., /) -> Lib: ... else: - def dlopen(self, __libpath: str | CData | None = ..., __flags: int = ...) -> Lib: ... + def dlopen(self, libpath: str | CData | None = ..., flags: int = ..., /) -> Lib: ... @overload def from_buffer(self, cdecl: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ... @@ -175,7 +175,7 @@ class FFI: def from_buffer(self, cdecl: str | CType, python_buffer: ReadableBuffer, require_writable: Literal[False] = ...) -> CData: ... @overload def from_buffer(self, cdecl: str | CType, python_buffer: WriteableBuffer, require_writable: Literal[True]) -> CData: ... - def from_handle(self, __x: CData) -> Any: ... + def from_handle(self, x: CData, /) -> Any: ... @overload def gc(self, cdata: CData, destructor: Callable[[CData], Any], size: int = ...) -> CData: ... @overload @@ -199,68 +199,68 @@ class FFI: def new_allocator( self, alloc: Callable[[int], CData], free: Callable[[CData], Any], should_clear_after_alloc: bool = ... ) -> _Allocator: ... - def new_handle(self, __x: Any) -> CData: ... - def offsetof(self, __cdecl: str | CType, __field_or_index: str | int, *__fields_or_indexes: str | int) -> int: ... - def release(self, __cdata: CData) -> None: ... - def sizeof(self, __cdecl: str | CType | CData) -> int: ... + def new_handle(self, x: Any, /) -> CData: ... + def offsetof(self, cdecl: str | CType, field_or_index: str | int, /, *__fields_or_indexes: str | int) -> int: ... + def release(self, cdata: CData, /) -> None: ... + def sizeof(self, cdecl: str | CType | CData, /) -> int: ... def string(self, cdata: CData, maxlen: int = -1) -> bytes | str: ... def typeof(self, cdecl: str | CData) -> CType: ... def unpack(self, cdata: CData, length: int) -> bytes | str | list[Any]: ... -def alignof(__cdecl: CType) -> int: ... +def alignof(cdecl: CType, /) -> int: ... def callback( - __cdecl: CType, - __python_callable: Callable[..., _T], - __error: Any = ..., - __onerror: Callable[[Exception, Any, Any], None] | None = ..., -) -> Callable[..., _T]: ... -def cast(__cdecl: CType, __value: _CDataBase) -> _CDataBase: ... + cdecl: CType, + python_callable: Callable[..., _T], + error: Any = ..., + onerror: Callable[[Exception, Any, Any], None] | None = ..., +/) -> Callable[..., _T]: ... +def cast(cdecl: CType, value: _CDataBase, /) -> _CDataBase: ... def complete_struct_or_union( - __cdecl: CType, - __fields: list[tuple[str, CType, int, int]], - __ignored: Any, - __total_size: int, - __total_alignment: int, - __sflags: int, - __pack: int, -) -> None: ... + cdecl: CType, + fields: list[tuple[str, CType, int, int]], + ignored: Any, + total_size: int, + total_alignment: int, + sflags: int, + pack: int, +/) -> None: ... @overload -def from_buffer(__cdecl: CType, __python_buffer: ReadableBuffer, require_writable: Literal[False] = ...) -> _CDataBase: ... +def from_buffer(cdecl: CType, python_buffer: ReadableBuffer, /, require_writable: Literal[False] = ...) -> _CDataBase: ... @overload -def from_buffer(__cdecl: CType, __python_buffer: WriteableBuffer, require_writable: Literal[True]) -> _CDataBase: ... -def from_handle(__x: _CDataBase) -> Any: ... +def from_buffer(cdecl: CType, python_buffer: WriteableBuffer, /, require_writable: Literal[True]) -> _CDataBase: ... +def from_handle(x: _CDataBase, /) -> Any: ... @overload def gcp(cdata: _CDataBase, destructor: Callable[[_CDataBase], Any], size: int = ...) -> _CDataBase: ... @overload def gcp(cdata: _CDataBase, destructor: None, size: int = ...) -> None: ... def get_errno() -> int: ... -def getcname(__cdecl: CType, __replace_with: str) -> str: ... +def getcname(cdecl: CType, replace_with: str, /) -> str: ... if sys.platform == "win32": def getwinerror(code: int = ...) -> tuple[int, str]: ... if sys.platform == "win32": - def load_library(__libpath: str | _CDataBase, __flags: int = ...) -> CLibrary: ... + def load_library(libpath: str | _CDataBase, flags: int = ..., /) -> CLibrary: ... else: - def load_library(__libpath: str | _CDataBase | None = ..., __flags: int = ...) -> CLibrary: ... + def load_library(libpath: str | _CDataBase | None = ..., flags: int = ..., /) -> CLibrary: ... def memmove(dest: _CDataBase | WriteableBuffer, src: _CDataBase | ReadableBuffer, n: int) -> None: ... -def new_array_type(__cdecl: CType, __length: int | None) -> CType: ... -def new_enum_type(__name: str, __enumerators: tuple[str, ...], __enumvalues: tuple[Any, ...], __basetype: CType) -> CType: ... -def new_function_type(__args: tuple[CType, ...], __result: CType, __ellipsis: int, __abi: int) -> CType: ... -def new_pointer_type(__cdecl: CType) -> CType: ... -def new_primitive_type(__name: str) -> CType: ... -def new_struct_type(__name: str) -> CType: ... -def new_union_type(__name: str) -> CType: ... +def new_array_type(cdecl: CType, length: int | None, /) -> CType: ... +def new_enum_type(name: str, enumerators: tuple[str, ...], enumvalues: tuple[Any, ...], basetype: CType, /) -> CType: ... +def new_function_type(args: tuple[CType, ...], result: CType, ellipsis: int, abi: int, /) -> CType: ... +def new_pointer_type(cdecl: CType, /) -> CType: ... +def new_primitive_type(name: str, /) -> CType: ... +def new_struct_type(name: str, /) -> CType: ... +def new_union_type(name: str, /) -> CType: ... def new_void_type() -> CType: ... -def newp(__cdecl: CType, __init: Any = ...) -> _CDataBase: ... -def newp_handle(__cdecl: CType, __x: Any) -> _CDataBase: ... -def rawaddressof(__cdecl: CType, __cdata: _CDataBase, __offset: int) -> _CDataBase: ... -def release(__cdata: _CDataBase) -> None: ... -def set_errno(__errno: int) -> None: ... -def sizeof(__cdecl: CType | _CDataBase) -> int: ... +def newp(cdecl: CType, init: Any = ..., /) -> _CDataBase: ... +def newp_handle(cdecl: CType, x: Any, /) -> _CDataBase: ... +def rawaddressof(cdecl: CType, cdata: _CDataBase, offset: int, /) -> _CDataBase: ... +def release(cdata: _CDataBase, /) -> None: ... +def set_errno(errno: int, /) -> None: ... +def sizeof(cdecl: CType | _CDataBase, /) -> int: ... def string(cdata: _CDataBase, maxlen: int) -> bytes | str: ... -def typeof(__cdata: _CDataBase) -> CType: ... -def typeoffsetof(__cdecl: CType, __fieldname: str | int, __following: bool = ...) -> tuple[CType, int]: ... +def typeof(cdata: _CDataBase, /) -> CType: ... +def typeoffsetof(cdecl: CType, fieldname: str | int, following: bool = ..., /) -> tuple[CType, int]: ... def unpack(cdata: _CDataBase, length: int) -> bytes | str | list[Any]: ... diff --git a/stubs/click-spinner/click_spinner/__init__.pyi b/stubs/click-spinner/click_spinner/__init__.pyi index f36cbf0fd38d..6093bb0f4c01 100644 --- a/stubs/click-spinner/click_spinner/__init__.pyi +++ b/stubs/click-spinner/click_spinner/__init__.pyi @@ -9,7 +9,7 @@ __version__: str class _Stream(Protocol): def isatty(self) -> bool: ... def flush(self) -> None: ... - def write(self, __s: str) -> int: ... + def write(self, s: str, /) -> int: ... class Spinner: spinner_cycle: Iterator[str] diff --git a/stubs/colorama/colorama/ansitowin32.pyi b/stubs/colorama/colorama/ansitowin32.pyi index 094a08ee2df2..284ea97814ca 100644 --- a/stubs/colorama/colorama/ansitowin32.pyi +++ b/stubs/colorama/colorama/ansitowin32.pyi @@ -18,7 +18,7 @@ class StreamWrapper: def __getattr__(self, name: str) -> Any: ... def __enter__(self, *args: object, **kwargs: object) -> TextIO: ... def __exit__( - self, __t: type[BaseException] | None, __value: BaseException | None, __traceback: TracebackType | None, **kwargs: Any + self, t: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None, /, **kwargs: Any ) -> None: ... def write(self, text: str) -> None: ... def isatty(self) -> bool: ... diff --git a/stubs/docutils/docutils/languages/__init__.pyi b/stubs/docutils/docutils/languages/__init__.pyi index 35522c07a700..27afb6dffdbe 100644 --- a/stubs/docutils/docutils/languages/__init__.pyi +++ b/stubs/docutils/docutils/languages/__init__.pyi @@ -10,6 +10,6 @@ class _LanguageModule(Protocol): class LanguageImporter: def __call__(self, language_code: str, reporter: Reporter | None = None) -> _LanguageModule: ... - def __getattr__(self, __name: str) -> Incomplete: ... + def __getattr__(self, name: str, /) -> Incomplete: ... get_language: LanguageImporter diff --git a/stubs/docutils/docutils/nodes.pyi b/stubs/docutils/docutils/nodes.pyi index ae0b4bf40e4e..5bd899485f9a 100644 --- a/stubs/docutils/docutils/nodes.pyi +++ b/stubs/docutils/docutils/nodes.pyi @@ -137,7 +137,7 @@ class Element(Node): def remove(self, item: Node) -> None: ... def insert(self, index: SupportsIndex, item: Node | Iterable[Node] | None) -> None: ... def previous_sibling(self) -> Node | None: ... - def __getattr__(self, __name: str) -> Incomplete: ... + def __getattr__(self, name: str, /) -> Incomplete: ... class TextElement(Element): # A few classes not subclassing TextElement have this, too @@ -403,7 +403,7 @@ class SparseNodeVisitor(NodeVisitor): ... class GenericNodeVisitor(NodeVisitor): # all the visit_ methods - def __getattr__(self, __name: str) -> Incomplete: ... + def __getattr__(self, name: str, /) -> Incomplete: ... class TreeCopyVisitor(GenericNodeVisitor): parent_stack: list[Node] diff --git a/stubs/docutils/docutils/transforms/__init__.pyi b/stubs/docutils/docutils/transforms/__init__.pyi index 7a2c0d6a5afc..13323fcbb468 100644 --- a/stubs/docutils/docutils/transforms/__init__.pyi +++ b/stubs/docutils/docutils/transforms/__init__.pyi @@ -4,11 +4,11 @@ from docutils.nodes import Node, document class Transform: def __init__(self, document: document, startnode: Node | None = None): ... - def __getattr__(self, __name: str) -> Incomplete: ... + def __getattr__(self, name: str, /) -> Incomplete: ... class Transformer: def __init__(self, document: document): ... def add_transform(self, transform_class: type[Transform], priority: int | None = None, **kwargs) -> None: ... - def __getattr__(self, __name: str) -> Incomplete: ... + def __getattr__(self, name: str, /) -> Incomplete: ... def __getattr__(name: str) -> Incomplete: ... diff --git a/stubs/fpdf2/fpdf/encryption.pyi b/stubs/fpdf2/fpdf/encryption.pyi index 38bf0a339af6..55c72a1d1d52 100644 --- a/stubs/fpdf2/fpdf/encryption.pyi +++ b/stubs/fpdf2/fpdf/encryption.pyi @@ -16,7 +16,7 @@ LOGGER: Logger import_error: ImportError | None class _SupportsGetItem(Protocol[_T_co]): - def __getitem__(self, __k: int) -> _T_co: ... + def __getitem__(self, k: int, /) -> _T_co: ... class ARC4: MOD: ClassVar[int] diff --git a/stubs/gdb/gdb/__init__.pyi b/stubs/gdb/gdb/__init__.pyi index d8c1ce8baa00..f24a9d633599 100644 --- a/stubs/gdb/gdb/__init__.pyi +++ b/stubs/gdb/gdb/__init__.pyi @@ -26,24 +26,24 @@ STDLOG: int def execute(command: str, from_tty: bool = ..., to_string: bool = ...) -> str | None: ... def breakpoints() -> Sequence[Breakpoint]: ... def rbreak(regex: str, minsyms: bool = ..., throttle: int = ..., symtabs: Iterator[Symtab] = ...) -> list[Breakpoint]: ... -def parameter(__parameter: str) -> bool | int | str | None: ... +def parameter(parameter: str, /) -> bool | int | str | None: ... def set_parameter(name: str, value: bool | int | str | None) -> None: ... def with_parameter(name: str, value: bool | int | str | None) -> AbstractContextManager[None]: ... -def history(__number: int) -> Value: ... -def add_history(__value: Value) -> int: ... +def history(number: int, /) -> Value: ... +def add_history(value: Value, /) -> int: ... def history_count() -> int: ... -def convenience_variable(__name: str) -> Value | None: ... -def set_convenience_variable(__name: str, __value: _ValueOrNative | None) -> None: ... -def parse_and_eval(__expression: str) -> Value: ... +def convenience_variable(name: str, /) -> Value | None: ... +def set_convenience_variable(name: str, value: _ValueOrNative | None, /) -> None: ... +def parse_and_eval(expression: str, /) -> Value: ... def find_pc_line(pc: int | Value) -> Symtab_and_line: ... -def post_event(__event: Callable[[], object]) -> None: ... +def post_event(event: Callable[[], object], /) -> None: ... def write(string: str, stream: int = ...) -> None: ... def flush(stream: int = ...) -> None: ... def target_charset() -> str: ... def target_wide_charset() -> str: ... def host_charset() -> str: ... def solib_name(addr: int) -> str | None: ... -def decode_line(__expression: str = ...) -> tuple[str | None, tuple[Symtab_and_line, ...] | None]: ... +def decode_line(expression: str = ..., /) -> tuple[str | None, tuple[Symtab_and_line, ...] | None]: ... def prompt_hook(current_prompt: str) -> str: ... def architecture_names() -> list[str]: ... def connections() -> list[TargetConnection]: ... @@ -195,7 +195,7 @@ class _PrettyPrinter(Protocol): _PrettyPrinterLookupFunction: TypeAlias = Callable[[Value], _PrettyPrinter | None] -def default_visualizer(__value: Value) -> _PrettyPrinter | None: ... +def default_visualizer(value: Value, /) -> _PrettyPrinter | None: ... # Selecting Pretty-Printers @@ -230,13 +230,13 @@ class _FrameDecorator(Protocol): @final class PendingFrame: - def read_register(self, __reg: str | RegisterDescriptor | int) -> Value: ... - def create_unwind_info(self, __frame_id: object) -> UnwindInfo: ... + def read_register(self, reg: str | RegisterDescriptor | int, /) -> Value: ... + def create_unwind_info(self, frame_id: object, /) -> UnwindInfo: ... def architecture(self) -> Architecture: ... def level(self) -> int: ... class UnwindInfo: - def add_saved_register(self, __reg: str | RegisterDescriptor | int, __value: Value) -> None: ... + def add_saved_register(self, reg: str | RegisterDescriptor | int, value: Value, /) -> None: ... class Unwinder: name: str @@ -289,7 +289,7 @@ class InferiorThread: # Recordings -def start_recording(__method: str = ..., __format: str = ...) -> Record: ... +def start_recording(method: str = ..., format: str = ..., /) -> Record: ... def current_recording() -> Record | None: ... def stop_recording() -> None: ... @@ -302,7 +302,7 @@ class Record: instruction_history: list[Instruction] function_call_history: list[RecordFunctionSegment] - def goto(self, __instruction: Instruction) -> None: ... + def goto(self, instruction: Instruction, /) -> None: ... class Instruction: pc: int @@ -337,7 +337,7 @@ class Command: def invoke(self, argument: str, from_tty: bool) -> None: ... def complete(self, text: str, word: str) -> object: ... -def string_to_argv(__argv: str) -> list[str]: ... +def string_to_argv(argv: str, /) -> list[str]: ... COMMAND_NONE: int COMMAND_RUNNING: int @@ -410,11 +410,11 @@ class Progspace: type_printers: list[gdb.types._TypePrinter] frame_filters: list[_FrameFilter] - def block_for_pc(self, __pc: int) -> Block | None: ... - def find_pc_line(self, __pc: int) -> Symtab_and_line: ... + def block_for_pc(self, pc: int, /) -> Block | None: ... + def find_pc_line(self, pc: int, /) -> Symtab_and_line: ... def is_valid(self) -> bool: ... def objfiles(self) -> Sequence[Objfile]: ... - def solib_name(self, __address: int) -> str | None: ... + def solib_name(self, address: int, /) -> str | None: ... # Objfiles @@ -441,7 +441,7 @@ class Objfile: def selected_frame() -> Frame: ... def newest_frame() -> Frame: ... -def frame_stop_reason_string(__code: int) -> str: ... +def frame_stop_reason_string(code: int, /) -> str: ... def invalidate_cached_frames() -> None: ... NORMAL_FRAME: int @@ -474,8 +474,8 @@ class Frame: def older(self) -> Frame | None: ... def newer(self) -> Frame | None: ... def find_sal(self) -> Symtab_and_line: ... - def read_register(self, __register: str | RegisterDescriptor | int) -> Value: ... - def read_var(self, __variable: str | Symbol, block: Block | None = ...) -> Value: ... + def read_register(self, register: str | RegisterDescriptor | int, /) -> Value: ... + def read_var(self, variable: str | Symbol, /, block: Block | None = ...) -> Value: ... def select(self) -> None: ... def level(self) -> int: ... @@ -524,7 +524,7 @@ class Symbol: is_variable: bool def is_valid(self) -> bool: ... - def value(self, __frame: Frame = ...) -> Value: ... + def value(self, frame: Frame = ..., /) -> Value: ... SYMBOL_UNDEF_DOMAIN: int SYMBOL_VAR_DOMAIN: int @@ -584,8 +584,8 @@ class LineTableEntry: class LineTable(Iterator[LineTableEntry]): def __iter__(self: _typeshed.Self) -> _typeshed.Self: ... def __next__(self) -> LineTableEntry: ... - def line(self, __line: int) -> tuple[LineTableEntry, ...]: ... - def has_line(self, __line: int) -> bool: ... + def line(self, line: int, /) -> tuple[LineTableEntry, ...]: ... + def has_line(self, line: int, /) -> bool: ... def source_lnes(self) -> list[int]: ... # Breakpoints @@ -705,7 +705,7 @@ class TuiWindow: def is_valid(self) -> bool: ... def erase(self) -> None: ... - def write(self, __string: str, __full_window: bool = ...) -> None: ... + def write(self, string: str, full_window: bool = ..., /) -> None: ... class _Window(Protocol): def close(self) -> None: ... diff --git a/stubs/gdb/gdb/events.pyi b/stubs/gdb/gdb/events.pyi index 72d4fc503389..88fe7c5667b3 100644 --- a/stubs/gdb/gdb/events.pyi +++ b/stubs/gdb/gdb/events.pyi @@ -8,8 +8,8 @@ class ThreadEvent: class ContinueEvent(ThreadEvent): ... class ContinueEventRegistry: - def connect(self, __object: Callable[[ContinueEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[ContinueEvent], object]) -> None: ... + def connect(self, object: Callable[[ContinueEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[ContinueEvent], object], /) -> None: ... cont: ContinueEventRegistry @@ -18,8 +18,8 @@ class ExitedEvent: inferior: gdb.Inferior class ExitedEventRegistry: - def connect(self, __object: Callable[[ExitedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[ExitedEvent], object]) -> None: ... + def connect(self, object: Callable[[ExitedEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[ExitedEvent], object], /) -> None: ... exited: ExitedEventRegistry @@ -31,8 +31,8 @@ class BreakpointEvent(StopEvent): breakpoint: gdb.Breakpoint class StopEventRegistry: - def connect(self, __object: Callable[[StopEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[StopEvent], object]) -> None: ... + def connect(self, object: Callable[[StopEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[StopEvent], object], /) -> None: ... stop: StopEventRegistry @@ -40,8 +40,8 @@ class NewObjFileEvent: new_objfile: gdb.Objfile class NewObjFileEventRegistry: - def connect(self, __object: Callable[[NewObjFileEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[NewObjFileEvent], object]) -> None: ... + def connect(self, object: Callable[[NewObjFileEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[NewObjFileEvent], object], /) -> None: ... new_objfile: NewObjFileEventRegistry @@ -49,8 +49,8 @@ class ClearObjFilesEvent: progspace: gdb.Progspace class ClearObjFilesEventRegistry: - def connect(self, __object: Callable[[ClearObjFilesEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[ClearObjFilesEvent], object]) -> None: ... + def connect(self, object: Callable[[ClearObjFilesEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[ClearObjFilesEvent], object], /) -> None: ... clear_objfiles: ClearObjFilesEventRegistry @@ -65,8 +65,8 @@ class InferiorCallPostEvent(InferiorCallEvent): address: gdb.Value class InferiorCallEventRegistry: - def connect(self, __object: Callable[[InferiorCallEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[InferiorCallEvent], object]) -> None: ... + def connect(self, object: Callable[[InferiorCallEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[InferiorCallEvent], object], /) -> None: ... inferior_call: InferiorCallEventRegistry @@ -75,8 +75,8 @@ class MemoryChangedEvent: length: int class MemoryChangedEventRegistry: - def connect(self, __object: Callable[[MemoryChangedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[MemoryChangedEvent], object]) -> None: ... + def connect(self, object: Callable[[MemoryChangedEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[MemoryChangedEvent], object], /) -> None: ... memory_changed: MemoryChangedEventRegistry @@ -85,22 +85,22 @@ class RegisterChangedEvent: regnum: str class RegisterChangedEventRegistry: - def connect(self, __object: Callable[[RegisterChangedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[RegisterChangedEvent], object]) -> None: ... + def connect(self, object: Callable[[RegisterChangedEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[RegisterChangedEvent], object], /) -> None: ... register_changed: RegisterChangedEventRegistry class BreakpointEventRegistry: - def connect(self, __object: Callable[[gdb.Breakpoint], object]) -> None: ... - def disconnect(self, __object: Callable[[gdb.Breakpoint], object]) -> None: ... + def connect(self, object: Callable[[gdb.Breakpoint], object], /) -> None: ... + def disconnect(self, object: Callable[[gdb.Breakpoint], object], /) -> None: ... breakpoint_created: BreakpointEventRegistry breakpoint_modified: BreakpointEventRegistry breakpoint_deleted: BreakpointEventRegistry class BeforePromptEventRegistry: - def connect(self, __object: Callable[[], object]) -> None: ... - def disconnect(self, __object: Callable[[], object]) -> None: ... + def connect(self, object: Callable[[], object], /) -> None: ... + def disconnect(self, object: Callable[[], object], /) -> None: ... before_prompt: BeforePromptEventRegistry @@ -108,8 +108,8 @@ class NewInferiorEvent: inferior: gdb.Inferior class NewInferiorEventRegistry: - def connect(self, __object: Callable[[NewInferiorEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[NewInferiorEvent], object]) -> None: ... + def connect(self, object: Callable[[NewInferiorEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[NewInferiorEvent], object], /) -> None: ... new_inferior: NewInferiorEventRegistry @@ -117,15 +117,15 @@ class InferiorDeletedEvent: inferior: gdb.Inferior class InferiorDeletedEventRegistry: - def connect(self, __object: Callable[[InferiorDeletedEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[InferiorDeletedEvent], object]) -> None: ... + def connect(self, object: Callable[[InferiorDeletedEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[InferiorDeletedEvent], object], /) -> None: ... inferior_deleted: InferiorDeletedEventRegistry class NewThreadEvent(ThreadEvent): ... class NewThreadEventRegistry: - def connect(self, __object: Callable[[NewThreadEvent], object]) -> None: ... - def disconnect(self, __object: Callable[[NewThreadEvent], object]) -> None: ... + def connect(self, object: Callable[[NewThreadEvent], object], /) -> None: ... + def disconnect(self, object: Callable[[NewThreadEvent], object], /) -> None: ... new_thread: NewThreadEventRegistry diff --git a/stubs/gdb/gdb/types.pyi b/stubs/gdb/gdb/types.pyi index 5a88afb5abae..1fd39c81c9b8 100644 --- a/stubs/gdb/gdb/types.pyi +++ b/stubs/gdb/gdb/types.pyi @@ -18,7 +18,7 @@ class _TypePrinter(Protocol): def instantiate(self) -> _TypeRecognizer | None: ... class _TypeRecognizer(Protocol): - def recognize(self, __type: gdb.Type) -> str | None: ... + def recognize(self, type: gdb.Type, /) -> str | None: ... class TypePrinter: def __init__(self, name: str) -> None: ... diff --git a/stubs/gevent/gevent/_abstract_linkable.pyi b/stubs/gevent/gevent/_abstract_linkable.pyi index ee844ac06779..0c0d9a0756cc 100644 --- a/stubs/gevent/gevent/_abstract_linkable.pyi +++ b/stubs/gevent/gevent/_abstract_linkable.pyi @@ -8,6 +8,6 @@ class AbstractLinkable: def hub(self) -> Hub | None: ... def __init__(self, hub: Hub | None = None) -> None: ... def linkcount(self) -> int: ... - def rawlink(self, __callback: Callable[[Self], object]) -> None: ... + def rawlink(self, callback: Callable[[Self], object], /) -> None: ... def ready(self) -> bool: ... - def unlink(self, __callback: Callable[[Self], object]) -> None: ... + def unlink(self, callback: Callable[[Self], object], /) -> None: ... diff --git a/stubs/gevent/gevent/_fileobjectcommon.pyi b/stubs/gevent/gevent/_fileobjectcommon.pyi index 2aac3bc65e1e..2dfdf1d787d7 100644 --- a/stubs/gevent/gevent/_fileobjectcommon.pyi +++ b/stubs/gevent/gevent/_fileobjectcommon.pyi @@ -26,12 +26,12 @@ class FileObjectClosed(IOError): class FlushingBufferedWriter(io.BufferedWriter): ... class WriteallMixin: - def writeall(self, __b: ReadableBuffer) -> int: ... + def writeall(self, b: ReadableBuffer, /) -> int: ... class FileIO(io.FileIO): ... class WriteIsWriteallMixin(WriteallMixin): - def write(self, __b: ReadableBuffer) -> int: ... + def write(self, b: ReadableBuffer, /) -> int: ... class WriteallFileIO(WriteIsWriteallMixin, io.FileIO): ... # type: ignore[misc] @@ -87,7 +87,7 @@ class FileObjectBase(Generic[_IOT, AnyStr]): def close(self) -> None: ... def __getattr__(self, name: str) -> Any: ... def __enter__(self) -> Self: ... - def __exit__(self, __typ: type[BaseException] | None, __value: BaseException | None, __tb: TracebackType | None) -> None: ... + def __exit__(self, typ: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, /) -> None: ... def __iter__(self) -> Self: ... def __next__(self) -> AnyStr: ... def __bool__(self) -> bool: ... diff --git a/stubs/gevent/gevent/_hub_primitives.pyi b/stubs/gevent/gevent/_hub_primitives.pyi index f6efa4610481..f0cfe8a6836b 100644 --- a/stubs/gevent/gevent/_hub_primitives.pyi +++ b/stubs/gevent/gevent/_hub_primitives.pyi @@ -16,8 +16,8 @@ _Ts = TypeVarTuple("_Ts") _WaitableT = TypeVar("_WaitableT", bound=_Waitable) class _Waitable(Protocol): - def rawlink(self, __callback: Callable[[Any], object]) -> object: ... - def unlink(self, __callback: Callable[[Any], object]) -> object: ... + def rawlink(self, callback: Callable[[Any], object], /) -> object: ... + def unlink(self, callback: Callable[[Any], object], /) -> object: ... class WaitOperationsGreenlet(SwitchOutGreenletWithLoop): loop: _Loop diff --git a/stubs/gevent/gevent/_monitor.pyi b/stubs/gevent/gevent/_monitor.pyi index f2cf0227e9a5..782f99c5c5ca 100644 --- a/stubs/gevent/gevent/_monitor.pyi +++ b/stubs/gevent/gevent/_monitor.pyi @@ -14,7 +14,7 @@ _T = TypeVar("_T") # sorts of issues to reference a module that is not stubbed in typeshed, so # for now we punt and just define an alias for Interface and implementer we # can get rid of later -def implementer(__interface: Any) -> Callable[[_T], _T]: ... +def implementer(interface: Any, /) -> Callable[[_T], _T]: ... class MonitorWarning(RuntimeWarning): ... diff --git a/stubs/gevent/gevent/_types.pyi b/stubs/gevent/gevent/_types.pyi index 26f481e45bc5..16db1f4d497f 100644 --- a/stubs/gevent/gevent/_types.pyi +++ b/stubs/gevent/gevent/_types.pyi @@ -107,7 +107,7 @@ class _ChildWatcher(_Watcher, Protocol): # this matches Intersection[_Watcher, AsyncMixin] class _AsyncWatcher(_Watcher, Protocol): def send(self) -> None: ... - def send_ignoring_arg(self, __ignored: object) -> None: ... + def send_ignoring_arg(self, ignored: object, /) -> None: ... @property def pending(self) -> bool: ... diff --git a/stubs/gevent/gevent/_waiter.pyi b/stubs/gevent/gevent/_waiter.pyi index ed29f5879236..6d8b70420997 100644 --- a/stubs/gevent/gevent/_waiter.pyi +++ b/stubs/gevent/gevent/_waiter.pyi @@ -36,10 +36,10 @@ class Waiter(Generic[_T]): def switch(self, value: _T) -> None: ... @overload def throw( - self, __typ: type[BaseException], __val: BaseException | object = None, __tb: TracebackType | None = None - ) -> None: ... + self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, + /) -> None: ... @overload - def throw(self, __typ: BaseException = ..., __val: None = None, __tb: TracebackType | None = None) -> None: ... + def throw(self, typ: BaseException = ..., val: None = None, tb: TracebackType | None = None, /) -> None: ... def get(self) -> _T: ... def __call__(self, source: _ValueSource[_T]) -> None: ... diff --git a/stubs/gevent/gevent/baseserver.pyi b/stubs/gevent/gevent/baseserver.pyi index aa7375c84f13..3a8ac540ae45 100644 --- a/stubs/gevent/gevent/baseserver.pyi +++ b/stubs/gevent/gevent/baseserver.pyi @@ -11,7 +11,7 @@ from greenlet import greenlet _P = ParamSpec("_P") class _SpawnFunc(Protocol): - def __call__(self, __func: Callable[_P, object], *args: _P.args, **kwargs: _P.kwargs) -> greenlet: ... + def __call__(self, func: Callable[_P, object], /, *args: _P.args, **kwargs: _P.kwargs) -> greenlet: ... _Spawner: TypeAlias = Pool | _SpawnFunc | int | Literal["default"] | None @@ -35,7 +35,7 @@ class BaseServer(Generic[_P]): spawn: _Spawner = "default", ) -> None: ... def __enter__(self) -> Self: ... - def __exit__(self, __typ: type[BaseException] | None, __value: BaseException | None, __tb: TracebackType | None) -> None: ... + def __exit__(self, typ: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None, /) -> None: ... def set_listener(self, listener: _GeventSocket | tuple[str, int] | str) -> None: ... def set_spawn(self, spawn: _Spawner) -> None: ... def set_handle(self, handle: Callable[_P, object]) -> None: ... diff --git a/stubs/gevent/gevent/events.pyi b/stubs/gevent/gevent/events.pyi index 3e1e9c9d82a9..f905ef73e1cc 100644 --- a/stubs/gevent/gevent/events.pyi +++ b/stubs/gevent/gevent/events.pyi @@ -15,7 +15,7 @@ _T = TypeVar("_T") # can get rid of later Interface: TypeAlias = Any -def implementer(__interface: Interface) -> Callable[[_T], _T]: ... +def implementer(interface: Interface, /) -> Callable[[_T], _T]: ... # this is copied from types-psutil, it would be nice if we could just import this # but it doesn't seem like we can... diff --git a/stubs/gevent/gevent/greenlet.pyi b/stubs/gevent/gevent/greenlet.pyi index e027b3421333..efc5b2cff217 100644 --- a/stubs/gevent/gevent/greenlet.pyi +++ b/stubs/gevent/gevent/greenlet.pyi @@ -56,7 +56,7 @@ class Greenlet(greenlet.greenlet, Generic[_P, _T]): def run(self) -> Any: ... @overload @classmethod - def spawn(cls, __run: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) -> Self: ... + def spawn(cls, run: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Self: ... @overload @classmethod def spawn(cls) -> Greenlet[[], None]: ... diff --git a/stubs/gevent/gevent/pool.pyi b/stubs/gevent/gevent/pool.pyi index d4e728c83112..76996403f34e 100644 --- a/stubs/gevent/gevent/pool.pyi +++ b/stubs/gevent/gevent/pool.pyi @@ -165,7 +165,7 @@ class Group(GroupMappingMixin): @overload def __init__(self) -> None: ... @overload - def __init__(self, __grenlets: Collection[Greenlet[..., object]]) -> None: ... + def __init__(self, grenlets: Collection[Greenlet[..., object]], /) -> None: ... def __len__(self) -> int: ... def __contains__(self, item: Greenlet[..., object]) -> bool: ... def __iter__(self) -> Iterator[Greenlet[..., object]]: ... diff --git a/stubs/gevent/gevent/pywsgi.pyi b/stubs/gevent/gevent/pywsgi.pyi index d512d6f63896..8c25035fd2cb 100644 --- a/stubs/gevent/gevent/pywsgi.pyi +++ b/stubs/gevent/gevent/pywsgi.pyi @@ -18,7 +18,7 @@ __all__ = ["WSGIServer", "WSGIHandler", "LoggingLogAdapter", "Environ", "SecureE _T = TypeVar("_T") class _LogOutputStream(SupportsWrite[str], Protocol): - def writelines(self, __lines: Iterable[str]) -> None: ... + def writelines(self, lines: Iterable[str], /) -> None: ... def flush(self) -> None: ... class Input: diff --git a/stubs/gevent/gevent/server.pyi b/stubs/gevent/gevent/server.pyi index 71608e51fc3b..36ce8d951f6e 100644 --- a/stubs/gevent/gevent/server.pyi +++ b/stubs/gevent/gevent/server.pyi @@ -79,6 +79,6 @@ class DatagramServer(BaseServer[[_GeventSocket, _Address]]): def get_listener(cls, address: _StrictAddress, family: int | None = None) -> _GeventSocket: ... def do_read(self) -> tuple[_GeventSocket, _Address]: ... @overload - def sendto(self, __data: ReadableBuffer, __address: _StrictAddress) -> int: ... + def sendto(self, data: ReadableBuffer, address: _StrictAddress, /) -> int: ... @overload - def sendto(self, __data: ReadableBuffer, __flags: int, __address: _StrictAddress) -> int: ... + def sendto(self, data: ReadableBuffer, flags: int, address: _StrictAddress, /) -> int: ... diff --git a/stubs/greenlet/greenlet/_greenlet.pyi b/stubs/greenlet/greenlet/_greenlet.pyi index 9c85d6ac4873..11d46f847dc7 100644 --- a/stubs/greenlet/greenlet/_greenlet.pyi +++ b/stubs/greenlet/greenlet/_greenlet.pyi @@ -47,10 +47,10 @@ class greenlet: def switch(self, *args: Any, **kwargs: Any) -> Any: ... @overload def throw( - self, __typ: type[BaseException] = ..., __val: BaseException | object = None, __tb: TracebackType | None = None - ) -> Any: ... + self, typ: type[BaseException] = ..., val: BaseException | object = None, tb: TracebackType | None = None, + /) -> Any: ... @overload - def throw(self, __typ: BaseException = ..., __val: None = None, __tb: TracebackType | None = None) -> Any: ... + def throw(self, typ: BaseException = ..., val: None = None, tb: TracebackType | None = None, /) -> Any: ... def __bool__(self) -> bool: ... # aliases for some module attributes/methods @@ -61,18 +61,18 @@ class greenlet: @staticmethod def gettrace() -> _TraceCallback | None: ... @staticmethod - def settrace(__callback: _TraceCallback | None) -> _TraceCallback | None: ... + def settrace(callback: _TraceCallback | None, /) -> _TraceCallback | None: ... class UnswitchableGreenlet(greenlet): # undocumented force_switch_error: bool force_slp_switch_error: bool -def enable_optional_cleanup(__enabled: bool) -> None: ... +def enable_optional_cleanup(enabled: bool, /) -> None: ... def get_clocks_used_doing_optional_cleanup() -> int: ... def get_pending_cleanup_count() -> int: ... def get_total_main_greenlets() -> int: ... def get_tstate_trash_delete_nesting() -> int: ... def getcurrent() -> greenlet: ... def gettrace() -> _TraceCallback | None: ... -def set_thread_local(__key: object, __value: object) -> None: ... -def settrace(__callback: _TraceCallback | None) -> _TraceCallback | None: ... +def set_thread_local(key: object, value: object, /) -> None: ... +def settrace(callback: _TraceCallback | None, /) -> _TraceCallback | None: ... diff --git a/stubs/ibm-db/ibm_db.pyi b/stubs/ibm-db/ibm_db.pyi index 9f094343d4d4..039780646bf4 100644 --- a/stubs/ibm-db/ibm_db.pyi +++ b/stubs/ibm-db/ibm_db.pyi @@ -216,131 +216,131 @@ class IBM_DBServerInfo: class IBM_DBStatement: def __new__(cls, *args: object, **kwargs: object) -> Self: ... -def active(__connection: IBM_DBConnection | None) -> bool: ... -def autocommit(__connection: IBM_DBConnection, __value: int = ...) -> int | bool: ... +def active(connection: IBM_DBConnection | None, /) -> bool: ... +def autocommit(connection: IBM_DBConnection, value: int = ..., /) -> int | bool: ... def bind_param( - __stmt: IBM_DBStatement, - __parameter_number: int, - __variable: str, - __parameter_type: int | None = ..., - __data_type: int | None = ..., - __precision: int | None = ..., - __scale: int | None = ..., - __size: int | None = ..., -) -> bool: ... + stmt: IBM_DBStatement, + parameter_number: int, + variable: str, + parameter_type: int | None = ..., + data_type: int | None = ..., + precision: int | None = ..., + scale: int | None = ..., + size: int | None = ..., +/) -> bool: ... @overload -def callproc(__connection: IBM_DBConnection, __procname: str) -> IBM_DBStatement | None: ... +def callproc(connection: IBM_DBConnection, procname: str, /) -> IBM_DBStatement | None: ... @overload -def callproc(__connection: IBM_DBConnection, __procname: str, __parameters: tuple[object, ...]) -> tuple[object, ...] | None: ... -def check_function_support(__connection: IBM_DBConnection, __function_id: int) -> bool: ... -def client_info(__connection: IBM_DBConnection) -> IBM_DBClientInfo | bool: ... -def close(__connection: IBM_DBConnection) -> bool: ... +def callproc(connection: IBM_DBConnection, procname: str, parameters: tuple[object, ...], /) -> tuple[object, ...] | None: ... +def check_function_support(connection: IBM_DBConnection, function_id: int, /) -> bool: ... +def client_info(connection: IBM_DBConnection, /) -> IBM_DBClientInfo | bool: ... +def close(connection: IBM_DBConnection, /) -> bool: ... def column_privileges( - __connection: IBM_DBConnection, - __qualifier: str | None = ..., - __schema: str | None = ..., - __table_name: str | None = ..., - __column_name: str | None = ..., -) -> IBM_DBStatement: ... + connection: IBM_DBConnection, + qualifier: str | None = ..., + schema: str | None = ..., + table_name: str | None = ..., + column_name: str | None = ..., +/) -> IBM_DBStatement: ... def columns( - __connection: IBM_DBConnection, - __qualifier: str | None = ..., - __schema: str | None = ..., - __table_name: str | None = ..., - __column_name: str | None = ..., -) -> IBM_DBStatement: ... -def commit(__connection: IBM_DBConnection) -> bool: ... -def conn_error(__connection: IBM_DBConnection | None = ...) -> str: ... -def conn_errormsg(__connection: IBM_DBConnection | None = ...) -> str: ... -def conn_warn(__connection: IBM_DBConnection | None = ...) -> str: ... + connection: IBM_DBConnection, + qualifier: str | None = ..., + schema: str | None = ..., + table_name: str | None = ..., + column_name: str | None = ..., +/) -> IBM_DBStatement: ... +def commit(connection: IBM_DBConnection, /) -> bool: ... +def conn_error(connection: IBM_DBConnection | None = ..., /) -> str: ... +def conn_errormsg(connection: IBM_DBConnection | None = ..., /) -> str: ... +def conn_warn(connection: IBM_DBConnection | None = ..., /) -> str: ... def connect( - __database: str, - __user: str, - __password: str, - __options: dict[int, int | str] | None = ..., - __replace_quoted_literal: int = ..., -) -> IBM_DBConnection | None: ... -def createdb(__connection: IBM_DBConnection, __dbName: str, __codeSet: str = ..., __mode: str = ...) -> bool: ... -def createdbNX(__connection: IBM_DBConnection, __dbName: str, __codeSet: str = ..., __mode: str = ...) -> bool: ... -def cursor_type(__stmt: IBM_DBStatement) -> int: ... -def dropdb(__connection: IBM_DBConnection, __dbName: str) -> bool: ... + database: str, + user: str, + password: str, + options: dict[int, int | str] | None = ..., + replace_quoted_literal: int = ..., +/) -> IBM_DBConnection | None: ... +def createdb(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ... +def createdbNX(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ... +def cursor_type(stmt: IBM_DBStatement, /) -> int: ... +def dropdb(connection: IBM_DBConnection, dbName: str, /) -> bool: ... def exec_immediate( - __connection: IBM_DBConnection, __statement: str | None, __options: dict[int, int] = ... -) -> IBM_DBStatement | bool: ... -def execute(__stmt: IBM_DBStatement, __parameters: tuple[object, ...] | None = ...) -> bool: ... + connection: IBM_DBConnection, statement: str | None, options: dict[int, int] = ..., +/) -> IBM_DBStatement | bool: ... +def execute(stmt: IBM_DBStatement, parameters: tuple[object, ...] | None = ..., /) -> bool: ... def execute_many( - __stmt: IBM_DBStatement, __seq_of_parameters: tuple[object, ...], __options: dict[int, int] = ... -) -> int | None: ... -def fetch_assoc(__stmt: IBM_DBStatement, __row_number: int = ...) -> dict[str, object] | bool: ... -def fetch_both(__stmt: IBM_DBStatement, __row_number: int = ...) -> dict[int | str, object] | bool: ... -def fetch_row(__stmt: IBM_DBStatement, __row_number: int = ...) -> bool: ... -def fetch_tuple(__stmt: IBM_DBStatement, __row_number: int = ...) -> tuple[object, ...]: ... -def field_display_size(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... -def field_name(__stmt: IBM_DBStatement, __column: int | str) -> str | bool: ... -def field_nullable(__stmt: IBM_DBStatement, __column: int | str) -> bool: ... -def field_num(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... -def field_precision(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... -def field_scale(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... -def field_type(__stmt: IBM_DBStatement, __column: int | str) -> str | bool: ... -def field_width(__stmt: IBM_DBStatement, __column: int | str) -> int | bool: ... + stmt: IBM_DBStatement, seq_of_parameters: tuple[object, ...], options: dict[int, int] = ..., +/) -> int | None: ... +def fetch_assoc(stmt: IBM_DBStatement, row_number: int = ..., /) -> dict[str, object] | bool: ... +def fetch_both(stmt: IBM_DBStatement, row_number: int = ..., /) -> dict[int | str, object] | bool: ... +def fetch_row(stmt: IBM_DBStatement, row_number: int = ..., /) -> bool: ... +def fetch_tuple(stmt: IBM_DBStatement, row_number: int = ..., /) -> tuple[object, ...]: ... +def field_display_size(stmt: IBM_DBStatement, column: int | str, /) -> int | bool: ... +def field_name(stmt: IBM_DBStatement, column: int | str, /) -> str | bool: ... +def field_nullable(stmt: IBM_DBStatement, column: int | str, /) -> bool: ... +def field_num(stmt: IBM_DBStatement, column: int | str, /) -> int | bool: ... +def field_precision(stmt: IBM_DBStatement, column: int | str, /) -> int | bool: ... +def field_scale(stmt: IBM_DBStatement, column: int | str, /) -> int | bool: ... +def field_type(stmt: IBM_DBStatement, column: int | str, /) -> str | bool: ... +def field_width(stmt: IBM_DBStatement, column: int | str, /) -> int | bool: ... def foreign_keys( - __connection: IBM_DBConnection, - __pk_qualifier: str | None, - __pk_schema: str | None, - __pk_table_name: str | None, - __fk_qualifier: str | None = ..., - __fk_schema: str | None = ..., - __fk_table_name: str | None = ..., -) -> IBM_DBStatement: ... -def free_result(__stmt: IBM_DBStatement) -> bool: ... -def free_stmt(__stmt: IBM_DBStatement) -> bool: ... -def get_db_info(__connection: IBM_DBConnection, __option: int) -> str | bool: ... -def get_last_serial_value(__stmt: IBM_DBStatement) -> str | bool: ... -def get_num_result(__stmt: IBM_DBStatement) -> int | bool: ... -def get_option(__resc: IBM_DBConnection | IBM_DBStatement, __options: int, __type: int) -> Any: ... -def next_result(__stmt: IBM_DBStatement) -> IBM_DBStatement | bool: ... -def num_fields(__stmt: IBM_DBStatement) -> int | bool: ... -def num_rows(__stmt: IBM_DBStatement) -> int: ... + connection: IBM_DBConnection, + pk_qualifier: str | None, + pk_schema: str | None, + pk_table_name: str | None, + fk_qualifier: str | None = ..., + fk_schema: str | None = ..., + fk_table_name: str | None = ..., +/) -> IBM_DBStatement: ... +def free_result(stmt: IBM_DBStatement, /) -> bool: ... +def free_stmt(stmt: IBM_DBStatement, /) -> bool: ... +def get_db_info(connection: IBM_DBConnection, option: int, /) -> str | bool: ... +def get_last_serial_value(stmt: IBM_DBStatement, /) -> str | bool: ... +def get_num_result(stmt: IBM_DBStatement, /) -> int | bool: ... +def get_option(resc: IBM_DBConnection | IBM_DBStatement, options: int, type: int, /) -> Any: ... +def next_result(stmt: IBM_DBStatement, /) -> IBM_DBStatement | bool: ... +def num_fields(stmt: IBM_DBStatement, /) -> int | bool: ... +def num_rows(stmt: IBM_DBStatement, /) -> int: ... def pconnect( - __database: str, __username: str, __password: str, __options: dict[int, int | str] | None = ... -) -> IBM_DBConnection | None: ... + database: str, username: str, password: str, options: dict[int, int | str] | None = ..., +/) -> IBM_DBConnection | None: ... def prepare( - __connection: IBM_DBConnection, __statement: str, __options: dict[int, int | str] | None = ... -) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, statement: str, options: dict[int, int | str] | None = ..., +/) -> IBM_DBStatement | bool: ... def primary_keys( - __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __table_name: str | None -) -> IBM_DBStatement: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, +/) -> IBM_DBStatement: ... def procedure_columns( - __connection: IBM_DBConnection, - __qualifier: str | None, - __schema: str | None, - __procedure: str | None, - __parameter: str | None, -) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, + qualifier: str | None, + schema: str | None, + procedure: str | None, + parameter: str | None, +/) -> IBM_DBStatement | bool: ... def procedures( - __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __procedure: str | None -) -> IBM_DBStatement | bool: ... -def recreatedb(__connection: IBM_DBConnection, __dbName: str, __codeSet: str | None = ..., __mode: str | None = ...) -> bool: ... -def result(__stmt: IBM_DBStatement, __column: int | str) -> Any: ... -def rollback(__connection: IBM_DBConnection) -> bool: ... -def server_info(__connection: IBM_DBConnection) -> IBM_DBServerInfo | bool: ... -def set_option(__resc: IBM_DBConnection | IBM_DBStatement, __options: dict[int, int | str], __type: int) -> bool: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, procedure: str | None, +/) -> IBM_DBStatement | bool: ... +def recreatedb(connection: IBM_DBConnection, dbName: str, codeSet: str | None = ..., mode: str | None = ..., /) -> bool: ... +def result(stmt: IBM_DBStatement, column: int | str, /) -> Any: ... +def rollback(connection: IBM_DBConnection, /) -> bool: ... +def server_info(connection: IBM_DBConnection, /) -> IBM_DBServerInfo | bool: ... +def set_option(resc: IBM_DBConnection | IBM_DBStatement, options: dict[int, int | str], type: int, /) -> bool: ... def special_columns( - __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __table_name: str | None, __scope: int -) -> IBM_DBStatement: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, scope: int, +/) -> IBM_DBStatement: ... def statistics( - __connection: IBM_DBConnection, __qualifier: str | None, __schema: str | None, __table_name: str | None, __unique: bool | None -) -> IBM_DBStatement: ... -def stmt_error(__stmt: IBM_DBStatement = ...) -> str: ... -def stmt_errormsg(__stmt: IBM_DBStatement = ...) -> str: ... -def stmt_warn(__connection: IBM_DBConnection = ...) -> IBM_DBStatement: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, unique: bool | None, +/) -> IBM_DBStatement: ... +def stmt_error(stmt: IBM_DBStatement = ..., /) -> str: ... +def stmt_errormsg(stmt: IBM_DBStatement = ..., /) -> str: ... +def stmt_warn(connection: IBM_DBConnection = ..., /) -> IBM_DBStatement: ... def table_privileges( - __connection: IBM_DBConnection, __qualifier: str | None = ..., __schema: str | None = ..., __table_name: str | None = ... -) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, qualifier: str | None = ..., schema: str | None = ..., table_name: str | None = ..., +/) -> IBM_DBStatement | bool: ... def tables( - __connection: IBM_DBConnection, - __qualifier: str | None = ..., - __schema: str | None = ..., - __table_name: str | None = ..., - __table_type: str | None = ..., -) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, + qualifier: str | None = ..., + schema: str | None = ..., + table_name: str | None = ..., + table_type: str | None = ..., +/) -> IBM_DBStatement | bool: ... diff --git a/stubs/jsonschema/jsonschema/_utils.pyi b/stubs/jsonschema/jsonschema/_utils.pyi index fd0207bd916e..e6725c1506cb 100644 --- a/stubs/jsonschema/jsonschema/_utils.pyi +++ b/stubs/jsonschema/jsonschema/_utils.pyi @@ -4,7 +4,7 @@ from collections.abc import Generator, Iterable, Iterator, Mapping, MutableMappi class URIDict(MutableMapping[str, str]): def normalize(self, uri: str) -> str: ... store: dict[str, str] - def __init__(self, __m: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]], **kwargs: str) -> None: ... + def __init__(self, m: SupportsKeysAndGetItem[str, str] | Iterable[tuple[str, str]], /, **kwargs: str) -> None: ... def __getitem__(self, uri: str) -> str: ... def __setitem__(self, uri: str, value: str) -> None: ... def __delitem__(self, uri: str) -> None: ... diff --git a/stubs/libsass/sass.pyi b/stubs/libsass/sass.pyi index 840b9a2c68c0..a95f96246607 100644 --- a/stubs/libsass/sass.pyi +++ b/stubs/libsass/sass.pyi @@ -162,13 +162,13 @@ class SassMap(Mapping[_KT, _VT_co]): @overload def __init__(self: SassMap[str, _VT_co], **kwargs: _VT_co) -> None: ... @overload - def __init__(self, __map: SupportsKeysAndGetItem[_KT, _VT_co]) -> None: ... + 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], map: SupportsKeysAndGetItem[str, _VT_co], /, **kwargs: _VT_co) -> None: ... @overload - def __init__(self, __iterable: Iterable[tuple[_KT, _VT_co]]) -> None: ... + 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], 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 d8355bdad0e1..6106426c6ee1 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -66,7 +66,7 @@ class _Call(tuple[Any, ...]): from_kall: bool = True, ) -> None: ... def __eq__(self, other: object) -> bool: ... - def __ne__(self, __other: object) -> bool: ... + def __ne__(self, other: object, /) -> bool: ... def __call__(self, *args: Any, **kwargs: Any) -> _Call: ... def __getattr__(self, attr: str) -> Any: ... @property @@ -204,8 +204,8 @@ class _patch(Generic[_T]): is_local: bool def __enter__(self) -> _T: ... def __exit__( - self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None - ) -> None: ... + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, + /) -> None: ... def start(self) -> _T: ... def stop(self) -> None: ... diff --git a/stubs/mypy-extensions/mypy_extensions.pyi b/stubs/mypy-extensions/mypy_extensions.pyi index ab0e3cf845dd..becb313889e9 100644 --- a/stubs/mypy-extensions/mypy_extensions.pyi +++ b/stubs/mypy-extensions/mypy_extensions.pyi @@ -22,22 +22,22 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta): def setdefault(self, k: Never, default: object) -> object: ... # Mypy plugin hook for 'pop' expects that 'default' has a type variable type. def pop(self, k: Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse] - def update(self, __m: Self) -> None: ... + def update(self, m: Self, /) -> None: ... def items(self) -> dict_items[str, object]: ... def keys(self) -> dict_keys[str, object]: ... def values(self) -> dict_values[str, object]: ... def __delitem__(self, k: Never) -> None: ... if sys.version_info >= (3, 9): @overload - def __or__(self, __value: Self) -> Self: ... + def __or__(self, value: Self, /) -> Self: ... @overload - def __or__(self, __value: dict[str, Any]) -> dict[str, object]: ... + def __or__(self, value: dict[str, Any], /) -> dict[str, object]: ... @overload - def __ror__(self, __value: Self) -> Self: ... + def __ror__(self, value: Self, /) -> Self: ... @overload - def __ror__(self, __value: dict[str, Any]) -> dict[str, object]: ... + def __ror__(self, value: dict[str, Any], /) -> dict[str, object]: ... # supposedly incompatible definitions of `__or__` and `__ior__`: - def __ior__(self, __value: Self) -> Self: ... # type: ignore[misc] + def __ior__(self, value: Self, /) -> Self: ... # type: ignore[misc] def TypedDict(typename: str, fields: dict[str, type[Any]], total: bool = ...) -> type[dict[str, Any]]: ... @overload diff --git a/stubs/mysqlclient/MySQLdb/_mysql.pyi b/stubs/mysqlclient/MySQLdb/_mysql.pyi index 4718cce16cdd..b8246512d090 100644 --- a/stubs/mysqlclient/MySQLdb/_mysql.pyi +++ b/stubs/mysqlclient/MySQLdb/_mysql.pyi @@ -64,8 +64,8 @@ class connection: def use_result(self, *args, **kwargs): ... def discard_result(self) -> None: ... def warning_count(self, *args, **kwargs): ... - def __delattr__(self, __name: str) -> None: ... - def __setattr__(self, __name: str, __value) -> None: ... + def __delattr__(self, name: str, /) -> None: ... + def __setattr__(self, name: str, value, /) -> None: ... class result: converter: Incomplete @@ -78,8 +78,8 @@ class result: def field_flags(self, *args, **kwargs): ... def num_fields(self, *args, **kwargs): ... def num_rows(self, *args, **kwargs): ... - def __delattr__(self, __name: str) -> None: ... - def __setattr__(self, __name: str, __value) -> None: ... + def __delattr__(self, name: str, /) -> None: ... + def __setattr__(self, name: str, value, /) -> None: ... def connect(*args, **kwargs): ... def debug(*args, **kwargs): ... diff --git a/stubs/netaddr/netaddr/ip/iana.pyi b/stubs/netaddr/netaddr/ip/iana.pyi index 76e5f9990b97..c02fdf39c347 100644 --- a/stubs/netaddr/netaddr/ip/iana.pyi +++ b/stubs/netaddr/netaddr/ip/iana.pyi @@ -26,7 +26,7 @@ class XMLRecordParser(Publisher): def consume_record(self, rec: object) -> None: ... def parse(self) -> None: ... # Arbitrary attributes are set in __init__ with `self.__dict__.update(kwargs)` - def __getattr__(self, __name: str) -> Any: ... + def __getattr__(self, name: str, /) -> Any: ... class IPv4Parser(XMLRecordParser): def process_record(self, rec: Mapping[str, object]) -> dict[str, str]: ... diff --git a/stubs/openpyxl/openpyxl/__init__.pyi b/stubs/openpyxl/openpyxl/__init__.pyi index 93fdac8047cd..0c1f04c63b93 100644 --- a/stubs/openpyxl/openpyxl/__init__.pyi +++ b/stubs/openpyxl/openpyxl/__init__.pyi @@ -27,4 +27,4 @@ _VisibilityType: TypeAlias = Literal["visible", "hidden", "veryHidden"] # noqa: _ZipFileFileProtocol: TypeAlias = StrPath | IO[bytes] | SupportsRead[bytes] # noqa: Y047 class _Decodable(Protocol): # noqa: Y046 - def decode(self, __encoding: str) -> str: ... + def decode(self, encoding: str, /) -> str: ... diff --git a/stubs/openpyxl/openpyxl/cell/rich_text.pyi b/stubs/openpyxl/openpyxl/cell/rich_text.pyi index 1be2f4a5cb3c..a5168ddf6b28 100644 --- a/stubs/openpyxl/openpyxl/cell/rich_text.pyi +++ b/stubs/openpyxl/openpyxl/cell/rich_text.pyi @@ -15,7 +15,7 @@ class TextBlock(Strict): class CellRichText(list[str | TextBlock]): @overload - def __init__(self, __args: list[str] | list[TextBlock] | list[str | TextBlock] | tuple[str | TextBlock, ...]) -> None: ... + def __init__(self, args: list[str] | list[TextBlock] | list[str | TextBlock] | tuple[str | TextBlock, ...], /) -> None: ... @overload def __init__(self, *args: str | TextBlock) -> None: ... @classmethod diff --git a/stubs/openpyxl/openpyxl/compat/singleton.pyi b/stubs/openpyxl/openpyxl/compat/singleton.pyi index 859a30110c22..28bb0fce854e 100644 --- a/stubs/openpyxl/openpyxl/compat/singleton.pyi +++ b/stubs/openpyxl/openpyxl/compat/singleton.pyi @@ -2,14 +2,14 @@ from typing import Any, overload class Singleton(type): @overload - def __init__(self, __o: object) -> None: ... + def __init__(self, o: object, /) -> None: ... @overload - def __init__(self, __name: str, __bases: tuple[type, ...], __dict: dict[str, Any], **kwds: Any) -> None: ... + def __init__(self, name: str, bases: tuple[type, ...], dict: dict[str, Any], /, **kwds: Any) -> None: ... def __call__(self, *args: Any, **kwds: Any) -> Any: ... class Cached(type): @overload - def __init__(self, __o: object) -> None: ... + def __init__(self, o: object, /) -> None: ... @overload - def __init__(self, __name: str, __bases: tuple[type, ...], __dict: dict[str, Any], **kwds: Any) -> None: ... + def __init__(self, name: str, bases: tuple[type, ...], dict: dict[str, Any], /, **kwds: Any) -> None: ... def __call__(self, *args: Any) -> Any: ... diff --git a/stubs/openpyxl/openpyxl/worksheet/_writer.pyi b/stubs/openpyxl/openpyxl/worksheet/_writer.pyi index a8375f550b9f..585c5029de5d 100644 --- a/stubs/openpyxl/openpyxl/worksheet/_writer.pyi +++ b/stubs/openpyxl/openpyxl/worksheet/_writer.pyi @@ -5,7 +5,7 @@ from typing_extensions import TypeAlias # WorksheetWriter.read has an explicit BytesIO branch. Let's make sure this protocol is viable for BytesIO too. class _SupportsCloseAndWrite(Protocol): - def write(self, __buffer: ReadableBuffer) -> Unused: ... + def write(self, buffer: ReadableBuffer, /) -> Unused: ... def close(self) -> Unused: ... # et_xmlfile.xmlfile accepts a str | _SupportsCloseAndWrite diff --git a/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi b/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi index f1f59c1e4328..fb682734f1b7 100644 --- a/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi +++ b/stubs/openpyxl/openpyxl/xml/_functions_overloads.pyi @@ -21,7 +21,7 @@ class _HasTag(Protocol): tag: str class _HasGet(Protocol[_T_co]): - def get(self, __value: str) -> _T_co | None: ... + def get(self, value: str, /) -> _T_co | None: ... class _HasText(Protocol): text: str @@ -34,7 +34,7 @@ class _HasTagAndText(_HasTag, _HasText, Protocol): ... # noqa: Y046 class _HasTagAndTextAndAttrib(_HasTag, _HasText, _HasAttrib, Protocol): ... # noqa: Y046 class _SupportsFindChartLines(Protocol): - def find(self, __path: str) -> ChartLines | None: ... + def find(self, path: str, /) -> ChartLines | None: ... class _SupportsFindAndIterAndAttribAndText( # noqa: Y046 _SupportsFindChartLines, Iterable[Incomplete], _HasAttrib, _HasText, Protocol @@ -46,8 +46,8 @@ class _SupportsIterAndAttribAndTextAndGet( # noqa: Y046 ): ... class _ParentElement(Protocol[_T]): - def makeelement(self, __tag: str, __attrib: dict[str, str]) -> _T: ... - def append(self, __element: _T) -> object: ... + def makeelement(self, tag: str, attrib: dict[str, str], /) -> _T: ... + def append(self, element: _T, /) -> object: ... # from lxml.etree import _Element _lxml_Element: TypeAlias = Element # noqa: Y042 diff --git a/stubs/paramiko/paramiko/client.pyi b/stubs/paramiko/paramiko/client.pyi index c6fe88441621..e6aae362f742 100644 --- a/stubs/paramiko/paramiko/client.pyi +++ b/stubs/paramiko/paramiko/client.pyi @@ -12,8 +12,8 @@ from paramiko.util import ClosingContextManager class _TransportFactory(Protocol): def __call__( self, - __sock: _SocketLike, - *, + sock: _SocketLike, + /, *, gss_kex: bool, gss_deleg_creds: bool, disabled_algorithms: Mapping[str, Iterable[str]] | None, diff --git a/stubs/peewee/peewee.pyi b/stubs/peewee/peewee.pyi index 7ee75c00f09e..76d5c30c4714 100644 --- a/stubs/peewee/peewee.pyi +++ b/stubs/peewee/peewee.pyi @@ -1596,15 +1596,15 @@ class Model(metaclass=ModelBase): @classmethod def select(cls, *fields): ... @classmethod - def update(cls, __data: Incomplete | None = ..., **update): ... + def update(cls, data: Incomplete | None = ..., /, **update): ... @classmethod - def insert(cls, __data: Incomplete | None = ..., **insert): ... + def insert(cls, data: Incomplete | None = ..., /, **insert): ... @classmethod def insert_many(cls, rows, fields: Incomplete | None = ...): ... @classmethod def insert_from(cls, query, fields): ... @classmethod - def replace(cls, __data: Incomplete | None = ..., **insert): ... + def replace(cls, data: Incomplete | None = ..., /, **insert): ... @classmethod def replace_many(cls, rows, fields: Incomplete | None = ...): ... @classmethod diff --git a/stubs/pexpect/pexpect/spawnbase.pyi b/stubs/pexpect/pexpect/spawnbase.pyi index d134a1afd7f8..384606784601 100644 --- a/stubs/pexpect/pexpect/spawnbase.pyi +++ b/stubs/pexpect/pexpect/spawnbase.pyi @@ -18,7 +18,7 @@ class _NullCoder: def decode(b: str, final: bool = False): ... class _Logfile(Protocol): - def write(self, __s) -> object: ... + def write(self, s, /) -> object: ... def flush(self) -> object: ... _ErrorPattern: TypeAlias = type[EOF | TIMEOUT] diff --git a/stubs/protobuf/google/protobuf/reflection.pyi b/stubs/protobuf/google/protobuf/reflection.pyi index 4bfbd2f4ce73..dae0fb93e630 100644 --- a/stubs/protobuf/google/protobuf/reflection.pyi +++ b/stubs/protobuf/google/protobuf/reflection.pyi @@ -1,6 +1,6 @@ class GeneratedProtocolMessageType(type): def __new__(cls, name, bases, dictionary): ... - def __init__(__self, name, bases, dictionary) -> None: ... + def __init__(self, /, name, bases, dictionary) -> None: ... def ParseMessage(descriptor, byte_str): ... def MakeClass(descriptor): ... diff --git a/stubs/psutil/psutil/_psutil_linux.pyi b/stubs/psutil/psutil/_psutil_linux.pyi index 72c51e0decbf..877715d040fb 100644 --- a/stubs/psutil/psutil/_psutil_linux.pyi +++ b/stubs/psutil/psutil/_psutil_linux.pyi @@ -5,7 +5,7 @@ DUPLEX_HALF: int DUPLEX_UNKNOWN: int version: int -def check_pid_range(__pid: int) -> None: ... +def check_pid_range(pid: int, /) -> None: ... def disk_partitions(*args, **kwargs) -> Any: ... def linux_sysinfo(*args, **kwargs) -> Any: ... def net_if_duplex_speed(*args, **kwargs) -> Any: ... diff --git a/stubs/psutil/psutil/_psutil_osx.pyi b/stubs/psutil/psutil/_psutil_osx.pyi index c027e43945e6..79f291bf9e3a 100644 --- a/stubs/psutil/psutil/_psutil_osx.pyi +++ b/stubs/psutil/psutil/_psutil_osx.pyi @@ -20,7 +20,7 @@ TCPS_TIME_WAIT: int version: int def boot_time(*args, **kwargs) -> Any: ... -def check_pid_range(__pid: int) -> None: ... +def check_pid_range(pid: int, /) -> None: ... def cpu_count_cores(*args, **kwargs) -> Any: ... def cpu_count_logical(*args, **kwargs) -> Any: ... def cpu_freq(*args, **kwargs) -> Any: ... diff --git a/stubs/psutil/psutil/_psutil_windows.pyi b/stubs/psutil/psutil/_psutil_windows.pyi index 3f3245d4528f..d0fc2b5e4022 100644 --- a/stubs/psutil/psutil/_psutil_windows.pyi +++ b/stubs/psutil/psutil/_psutil_windows.pyi @@ -35,7 +35,7 @@ class TimeoutExpired(Exception): ... def QueryDosDevice(*args, **kwargs): ... # incomplete def boot_time(*args, **kwargs): ... # incomplete -def check_pid_range(__pid: int) -> None: ... +def check_pid_range(pid: int, /) -> None: ... def cpu_count_cores(*args, **kwargs): ... # incomplete def cpu_count_logical(*args, **kwargs): ... # incomplete def cpu_freq(*args, **kwargs): ... # incomplete diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index 8979cf6dc27d..f80e741cbb7c 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -15,7 +15,7 @@ class _type: # The class doesn't exist at runtime but following attributes have type "psycopg2._psycopg.type" name: str values: tuple[int, ...] - def __call__(self, __value: str | bytes | None, __cur: cursor | None) -> Any: ... + def __call__(self, value: str | bytes | None, cur: cursor | None, /) -> Any: ... BINARY: _type BINARYARRAY: _type @@ -116,8 +116,8 @@ class cursor: def statusmessage(self) -> str | None: ... @property def pgresult_ptr(self) -> int | None: ... - def callproc(self, __procname: str | bytes, __parameters: _Vars = None) -> None: ... - def cast(self, __oid: int, __s: str | bytes) -> Any: ... + def callproc(self, procname: str | bytes, parameters: _Vars = None, /) -> None: ... + def cast(self, oid: int, s: str | bytes, /) -> Any: ... def close(self) -> None: ... def copy_expert( self, sql: str | bytes | Composable, file: _SupportsReadAndReadline | SupportsWrite[str], size: int = 8192 @@ -143,7 +143,7 @@ class cursor: def nextset(self) -> NoReturn: ... # not supported def scroll(self, value: int, mode: Literal["absolute", "relative"] = "relative") -> None: ... def setinputsizes(self, sizes: Unused) -> None: ... - def setoutputsize(self, __size: int, __column: int = ...) -> None: ... + def setoutputsize(self, size: int, column: int = ..., /) -> None: ... def __enter__(self) -> Self: ... def __exit__( self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None @@ -154,28 +154,28 @@ class cursor: _Cursor: TypeAlias = cursor class AsIs: - def __init__(self, __obj: object, **kwargs: Unused) -> None: ... + def __init__(self, obj: object, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... def getquoted(self) -> bytes: ... - def __conform__(self, __proto) -> Self | None: ... + def __conform__(self, proto, /) -> Self | None: ... class Binary: - def __init__(self, __str: object, **kwargs: Unused) -> None: ... + def __init__(self, str: object, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... @property def buffer(self) -> Any: ... def getquoted(self) -> bytes: ... - def prepare(self, __conn: connection) -> None: ... - def __conform__(self, __proto) -> Self | None: ... + def prepare(self, conn: connection, /) -> None: ... + def __conform__(self, proto, /) -> Self | None: ... class Boolean: - def __init__(self, __obj: object, **kwargs: Unused) -> None: ... + def __init__(self, obj: object, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... def getquoted(self) -> bytes: ... - def __conform__(self, __proto) -> Self | None: ... + def __conform__(self, proto, /) -> Self | None: ... class Column: display_size: Any @@ -188,15 +188,15 @@ class Column: table_oid: Any type_code: Any def __init__(self, *args, **kwargs) -> None: ... - def __eq__(self, __other): ... - def __ge__(self, __other): ... - def __getitem__(self, __index): ... + def __eq__(self, other, /): ... + def __ge__(self, other, /): ... + def __getitem__(self, index, /): ... def __getstate__(self): ... - def __gt__(self, __other): ... - def __le__(self, __other): ... + def __gt__(self, other, /): ... + def __le__(self, other, /): ... def __len__(self) -> int: ... - def __lt__(self, __other): ... - def __ne__(self, __other): ... + def __lt__(self, other, /): ... + def __ne__(self, other, /): ... def __setstate__(self, state): ... class ConnectionInfo: @@ -281,17 +281,17 @@ class Warning(Exception): ... class ISQLQuote: _wrapped: Any - def __init__(self, __wrapped: object, **kwargs) -> None: ... + def __init__(self, wrapped: object, /, **kwargs) -> None: ... def getbinary(self) -> Incomplete: ... def getbuffer(self) -> Incomplete: ... def getquoted(self) -> bytes: ... class Decimal: - def __init__(self, __value: object, **kwargs: Unused) -> None: ... + def __init__(self, value: object, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... def getquoted(self) -> bytes: ... - def __conform__(self, __proto) -> Self | None: ... + def __conform__(self, proto, /) -> Self | None: ... class Diagnostics: column_name: str | None @@ -312,55 +312,55 @@ class Diagnostics: sqlstate: str | None statement_position: str | None table_name: str | None - def __init__(self, __err: Error) -> None: ... + def __init__(self, err: Error, /) -> None: ... class Float: - def __init__(self, __value: float, **kwargs: Unused) -> None: ... + def __init__(self, value: float, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> float: ... def getquoted(self) -> bytes: ... - def __conform__(self, __proto) -> Self | None: ... + def __conform__(self, proto, /) -> Self | None: ... class Int: - def __init__(self, __value: ConvertibleToInt, **kwargs: Unused) -> None: ... + def __init__(self, value: ConvertibleToInt, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... def getquoted(self) -> bytes: ... - def __conform__(self, __proto) -> Self | None: ... + def __conform__(self, proto, /) -> Self | None: ... class List: - def __init__(self, __objs: list[object], **kwargs: Unused) -> None: ... + def __init__(self, objs: list[object], /, **kwargs: Unused) -> None: ... @property def adapted(self) -> list[Any]: ... def getquoted(self) -> bytes: ... - def prepare(self, __conn: connection) -> None: ... - def __conform__(self, __proto) -> Self | None: ... + def prepare(self, conn: connection, /) -> None: ... + def __conform__(self, proto, /) -> Self | None: ... class Notify: channel: Any payload: Any pid: Any def __init__(self, *args, **kwargs) -> None: ... - def __eq__(self, __other): ... - def __ge__(self, __other): ... - def __getitem__(self, __index): ... - def __gt__(self, __other): ... + def __eq__(self, other, /): ... + def __ge__(self, other, /): ... + def __getitem__(self, index, /): ... + def __gt__(self, other, /): ... def __hash__(self) -> int: ... - def __le__(self, __other): ... + def __le__(self, other, /): ... def __len__(self) -> int: ... - def __lt__(self, __other): ... - def __ne__(self, __other): ... + def __lt__(self, other, /): ... + def __ne__(self, other, /): ... class QuotedString: encoding: str - def __init__(self, __str: object, **kwargs: Unused) -> None: ... + def __init__(self, str: object, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... @property def buffer(self) -> Any: ... def getquoted(self) -> bytes: ... - def prepare(self, __conn: connection) -> None: ... - def __conform__(self, __proto) -> Self | None: ... + def prepare(self, conn: connection, /) -> None: ... + def __conform__(self, proto, /) -> Self | None: ... class ReplicationCursor(cursor): feedback_timestamp: Any @@ -390,7 +390,7 @@ class Xid: prepared: Any def __init__(self, *args, **kwargs) -> None: ... def from_string(self, *args, **kwargs): ... - def __getitem__(self, __index): ... + def __getitem__(self, index, /): ... def __len__(self) -> int: ... _T_cur = TypeVar("_T_cur", bound=cursor) @@ -423,7 +423,7 @@ class connection: @property def isolation_level(self) -> int | None: ... @isolation_level.setter - def isolation_level(self, __value: str | bytes | int | None) -> None: ... + def isolation_level(self, value: str | bytes | int | None, /) -> None: ... notices: list[str] notifies: list[Notify] @property @@ -433,11 +433,11 @@ class connection: @property def deferrable(self) -> bool | None: ... @deferrable.setter - def deferrable(self, __value: Literal["default"] | bool | None) -> None: ... + def deferrable(self, value: Literal["default"] | bool | None, /) -> None: ... @property def readonly(self) -> bool | None: ... @readonly.setter - def readonly(self, __value: Literal["default"] | bool | None) -> None: ... + def readonly(self, value: Literal["default"] | bool | None, /) -> None: ... @property def server_version(self) -> int: ... @property @@ -499,13 +499,13 @@ class connection: autocommit: bool = ..., ) -> None: ... def tpc_begin(self, xid: str | bytes | Xid) -> None: ... - def tpc_commit(self, __xid: str | bytes | Xid = ...) -> None: ... + def tpc_commit(self, xid: str | bytes | Xid = ..., /) -> None: ... def tpc_prepare(self) -> None: ... def tpc_recover(self) -> list[Xid]: ... - def tpc_rollback(self, __xid: str | bytes | Xid = ...) -> None: ... + def tpc_rollback(self, xid: str | bytes | Xid = ..., /) -> None: ... def xid(self, format_id, gtrid, bqual) -> Xid: ... def __enter__(self) -> Self: ... - def __exit__(self, __type: type[BaseException] | None, __name: BaseException | None, __tb: TracebackType | None) -> None: ... + def __exit__(self, type: type[BaseException] | None, name: BaseException | None, tb: TracebackType | None, /) -> None: ... _Connection: TypeAlias = connection @@ -561,34 +561,34 @@ class _datetime: # The class doesn't exist at runtime but functions below return "psycopg2._psycopg.datetime" objects # XXX: This and other classes that implement the `ISQLQuote` protocol could be made generic # in the return type of their `adapted` property if someone asks for it. - def __init__(self, __obj: object, __type: int = -1, **kwargs: Unused) -> None: ... + def __init__(self, obj: object, type: int = -1, /, **kwargs: Unused) -> None: ... @property def adapted(self) -> Any: ... @property def type(self) -> int: ... def getquoted(self) -> bytes: ... - def __conform__(self, __proto) -> Self | None: ... - -def Date(__year: int, __month: int, __day: int) -> _datetime: ... -def DateFromPy(__date: dt.date) -> _datetime: ... -def DateFromTicks(__ticks: float) -> _datetime: ... -def IntervalFromPy(__interval: dt.timedelta) -> _datetime: ... -def Time(__hour: int, __minutes: int, __seconds: float, __tzinfo: dt.tzinfo | None = None) -> _datetime: ... -def TimeFromPy(__time: dt.time) -> _datetime: ... -def TimeFromTicks(__ticks: float) -> _datetime: ... + def __conform__(self, proto, /) -> Self | None: ... + +def Date(year: int, month: int, day: int, /) -> _datetime: ... +def DateFromPy(date: dt.date, /) -> _datetime: ... +def DateFromTicks(ticks: float, /) -> _datetime: ... +def IntervalFromPy(interval: dt.timedelta, /) -> _datetime: ... +def Time(hour: int, minutes: int, seconds: float, tzinfo: dt.tzinfo | None = None, /) -> _datetime: ... +def TimeFromPy(time: dt.time, /) -> _datetime: ... +def TimeFromTicks(ticks: float, /) -> _datetime: ... def Timestamp( - __year: int, - __month: int, - __day: int, - __hour: int = 0, - __minutes: int = 0, - __seconds: float = 0, - __tzinfo: dt.tzinfo | None = None, -) -> _datetime: ... -def TimestampFromPy(__datetime: dt.datetime) -> _datetime: ... -def TimestampFromTicks(__ticks: float) -> _datetime: ... + year: int, + month: int, + day: int, + hour: int = 0, + minutes: int = 0, + seconds: float = 0, + tzinfo: dt.tzinfo | None = None, +/) -> _datetime: ... +def TimestampFromPy(datetime: dt.datetime, /) -> _datetime: ... +def TimestampFromTicks(ticks: float, /) -> _datetime: ... def _connect(*args, **kwargs): ... -def adapt(__obj: object, __protocol: Incomplete = ..., __alternate: Incomplete = ...) -> Any: ... +def adapt(obj: object, protocol: Incomplete = ..., alternate: Incomplete = ..., /) -> Any: ... def encrypt_password( password: str | bytes, user: str | bytes, scope: connection | cursor | None = None, algorithm: str | None = None ) -> str: ... @@ -603,5 +603,5 @@ def new_type( ) -> _type: ... def parse_dsn(dsn: str | bytes) -> dict[str, Any]: ... def quote_ident(ident: str | bytes, scope) -> str: ... -def register_type(__obj: _type, __conn_or_curs: connection | cursor | None = None) -> None: ... -def set_wait_callback(__none: Callable[..., Incomplete] | None) -> None: ... +def register_type(obj: _type, conn_or_curs: connection | cursor | None = None, /) -> None: ... +def set_wait_callback(none: Callable[..., Incomplete] | None, /) -> None: ... diff --git a/stubs/pyOpenSSL/OpenSSL/SSL.pyi b/stubs/pyOpenSSL/OpenSSL/SSL.pyi index d9278af1614d..0f91243577e2 100644 --- a/stubs/pyOpenSSL/OpenSSL/SSL.pyi +++ b/stubs/pyOpenSSL/OpenSSL/SSL.pyi @@ -169,7 +169,7 @@ class Connection: ) -> Incomplete: ... # TODO: type, see RFC-5705 def get_app_data(self) -> Any: ... def set_app_data(self, data: Any) -> None: ... - def sock_shutdown(self, __how: int) -> None: ... # alias to `_socket.socket.shutdown` + def sock_shutdown(self, how: int, /) -> None: ... # alias to `_socket.socket.shutdown` def want_read(self) -> bool: ... def want_write(self) -> bool: ... def get_session(self) -> Session | None: ... diff --git a/stubs/pycurl/pycurl.pyi b/stubs/pycurl/pycurl.pyi index 50e5ccb89f40..f818e2ac5e62 100644 --- a/stubs/pycurl/pycurl.pyi +++ b/stubs/pycurl/pycurl.pyi @@ -30,7 +30,7 @@ class Curl: def errstr(self) -> str: ... def duphandle(self) -> Self: ... def errstr_raw(self) -> bytes: ... - def set_ca_certs(self, __value: bytes | str) -> None: ... + def set_ca_certs(self, value: bytes | str, /) -> None: ... @final class CurlMulti: @@ -43,7 +43,7 @@ class CurlMulti: def select(self, timeout: float) -> int: ... def info_read(self, max_objects: int = ...) -> tuple[int, list[Incomplete], list[Incomplete]]: ... def socket_action(self, sockfd: int, ev_bitmask: int) -> tuple[int, int]: ... - def assign(self, __sockfd: int, __socket: Incomplete) -> Incomplete: ... + def assign(self, sockfd: int, socket: Incomplete, /) -> Incomplete: ... def socket_all(self) -> tuple[int, int]: ... def timeout(self) -> int: ... diff --git a/stubs/pyfarmhash/farmhash.pyi b/stubs/pyfarmhash/farmhash.pyi index 8b8fd0e96d29..cdb08e53a3c3 100644 --- a/stubs/pyfarmhash/farmhash.pyi +++ b/stubs/pyfarmhash/farmhash.pyi @@ -1,9 +1,9 @@ -def fingerprint128(__a: str) -> tuple[int, int]: ... -def fingerprint32(__a: str) -> int: ... -def fingerprint64(__a: str) -> int: ... -def hash128(__a: str) -> tuple[int, int]: ... -def hash128withseed(__a: str, __seed_low: int, __seed_high: int) -> tuple[int, int]: ... -def hash32(__a: str) -> int: ... -def hash32withseed(__a: str, __seed: int) -> int: ... -def hash64(__a: str) -> int: ... -def hash64withseed(__a: str, __seed: int) -> int: ... +def fingerprint128(a: str, /) -> tuple[int, int]: ... +def fingerprint32(a: str, /) -> int: ... +def fingerprint64(a: str, /) -> int: ... +def hash128(a: str, /) -> tuple[int, int]: ... +def hash128withseed(a: str, seed_low: int, seed_high: int, /) -> tuple[int, int]: ... +def hash32(a: str, /) -> int: ... +def hash32withseed(a: str, seed: int, /) -> int: ... +def hash64(a: str, /) -> int: ... +def hash64withseed(a: str, seed: int, /) -> int: ... diff --git a/stubs/pyinstaller/PyInstaller/utils/win32/versioninfo.pyi b/stubs/pyinstaller/PyInstaller/utils/win32/versioninfo.pyi index 8a88f17fd14e..6a6c89f51b68 100644 --- a/stubs/pyinstaller/PyInstaller/utils/win32/versioninfo.pyi +++ b/stubs/pyinstaller/PyInstaller/utils/win32/versioninfo.pyi @@ -8,7 +8,7 @@ _TwoIntSequence: TypeAlias = Sequence[int] class _Kid(Protocol): def toRaw(self) -> bytes: ... - def __str__(self, __indent: str = "") -> str: ... + def __str__(self, indent: str = "", /) -> str: ... # Used by other types referenced in https://pyinstaller.org/en/stable/spec-files.html#spec-file-operation class VSVersionInfo: diff --git a/stubs/pyserial/serial/rfc2217.pyi b/stubs/pyserial/serial/rfc2217.pyi index 6de6b35253e9..b7e751c14b06 100644 --- a/stubs/pyserial/serial/rfc2217.pyi +++ b/stubs/pyserial/serial/rfc2217.pyi @@ -151,7 +151,7 @@ class Serial(SerialBase): @property def in_waiting(self) -> int: ... def read(self, size: int = 1) -> bytes: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... @property diff --git a/stubs/pyserial/serial/serialcli.pyi b/stubs/pyserial/serial/serialcli.pyi index 51755168a1a4..f243980d4c03 100644 --- a/stubs/pyserial/serial/serialcli.pyi +++ b/stubs/pyserial/serial/serialcli.pyi @@ -12,7 +12,7 @@ class Serial(SerialBase): @property def in_waiting(self) -> int: ... def read(self, size: int = 1) -> bytes: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... @property diff --git a/stubs/pyserial/serial/serialjava.pyi b/stubs/pyserial/serial/serialjava.pyi index b250e75cb850..de4dcd57e6fc 100644 --- a/stubs/pyserial/serial/serialjava.pyi +++ b/stubs/pyserial/serial/serialjava.pyi @@ -17,7 +17,7 @@ class Serial(SerialBase): @property def in_waiting(self) -> int: ... def read(self, size: int = 1) -> bytes: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... @property diff --git a/stubs/pyserial/serial/serialposix.pyi b/stubs/pyserial/serial/serialposix.pyi index 4869f4ec97b8..e5251f81c655 100644 --- a/stubs/pyserial/serial/serialposix.pyi +++ b/stubs/pyserial/serial/serialposix.pyi @@ -68,7 +68,7 @@ class Serial(SerialBase, PlatformSpecific): def read(self, size: int = 1) -> bytes: ... def cancel_read(self) -> None: ... def cancel_write(self) -> None: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... def send_break(self, duration: float = ...) -> None: ... diff --git a/stubs/pyserial/serial/serialutil.pyi b/stubs/pyserial/serial/serialutil.pyi index 381dbc178647..4469f6697a72 100644 --- a/stubs/pyserial/serial/serialutil.pyi +++ b/stubs/pyserial/serial/serialutil.pyi @@ -76,9 +76,9 @@ class SerialBase(io.RawIOBase): # in terms of `read`. If subclasses do not implement `read`, any call to `read` or `read_into` # will fail at runtime with a `RecursionError`. @abstractmethod - def read(self, __size: int = -1) -> bytes: ... + def read(self, size: int = -1, /) -> bytes: ... @abstractmethod - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... @property def port(self) -> str | None: ... @port.setter @@ -145,7 +145,7 @@ class SerialBase(io.RawIOBase): def rs485_mode(self, rs485_settings: RS485Settings | None) -> None: ... def get_settings(self) -> dict[str, Any]: ... def apply_settings(self, d: dict[str, Any]) -> None: ... - def readinto(self, __buffer: WriteableBuffer) -> int: ... # returns int unlike `io.RawIOBase` + def readinto(self, buffer: WriteableBuffer, /) -> int: ... # returns int unlike `io.RawIOBase` def send_break(self, duration: float = 0.25) -> None: ... def read_all(self) -> bytes | None: ... def read_until(self, expected: bytes = b"\n", size: int | None = None) -> bytes: ... diff --git a/stubs/pyserial/serial/serialwin32.pyi b/stubs/pyserial/serial/serialwin32.pyi index 86d09dc25adc..8fb2e3ba38d6 100644 --- a/stubs/pyserial/serial/serialwin32.pyi +++ b/stubs/pyserial/serial/serialwin32.pyi @@ -7,7 +7,7 @@ class Serial(SerialBase): @property def in_waiting(self) -> int: ... def read(self, size: int = 1) -> bytes: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... @property diff --git a/stubs/pyserial/serial/threaded/__init__.pyi b/stubs/pyserial/serial/threaded/__init__.pyi index 73756a555b5b..8eb04014b3f4 100644 --- a/stubs/pyserial/serial/threaded/__init__.pyi +++ b/stubs/pyserial/serial/threaded/__init__.pyi @@ -44,5 +44,5 @@ class ReaderThread(threading.Thread): def connect(self) -> tuple[Self, Protocol]: ... def __enter__(self) -> Protocol: ... def __exit__( - self, __exc_type: type[BaseException] | None, __exc_val: BaseException | None, __exc_tb: TracebackType | None - ) -> None: ... + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, + /) -> None: ... diff --git a/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi b/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi index 38552f2ae456..661e9d3830a4 100644 --- a/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi +++ b/stubs/pyserial/serial/urlhandler/protocol_cp2110.pyi @@ -10,4 +10,4 @@ class Serial(SerialBase): def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... def read(self, size: int = 1) -> bytes: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... diff --git a/stubs/pyserial/serial/urlhandler/protocol_loop.pyi b/stubs/pyserial/serial/urlhandler/protocol_loop.pyi index b85c016c0874..0a262b0fd115 100644 --- a/stubs/pyserial/serial/urlhandler/protocol_loop.pyi +++ b/stubs/pyserial/serial/urlhandler/protocol_loop.pyi @@ -17,7 +17,7 @@ class Serial(SerialBase): def read(self, size: int = 1) -> bytes: ... def cancel_read(self) -> None: ... def cancel_write(self) -> None: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... @property diff --git a/stubs/pyserial/serial/urlhandler/protocol_socket.pyi b/stubs/pyserial/serial/urlhandler/protocol_socket.pyi index bf3572d6205a..9ac407eb76db 100644 --- a/stubs/pyserial/serial/urlhandler/protocol_socket.pyi +++ b/stubs/pyserial/serial/urlhandler/protocol_socket.pyi @@ -13,7 +13,7 @@ class Serial(SerialBase): @property def in_waiting(self) -> int: ... def read(self, size: int = 1) -> bytes: ... - def write(self, __b: ReadableBuffer) -> int | None: ... + def write(self, b: ReadableBuffer, /) -> int | None: ... def reset_input_buffer(self) -> None: ... def reset_output_buffer(self) -> None: ... @property diff --git a/stubs/python-dateutil/dateutil/tz/tz.pyi b/stubs/python-dateutil/dateutil/tz/tz.pyi index 054378b29677..6addba659e02 100644 --- a/stubs/python-dateutil/dateutil/tz/tz.pyi +++ b/stubs/python-dateutil/dateutil/tz/tz.pyi @@ -56,8 +56,8 @@ class _ttinfo: class _TZFileReader(Protocol): # optional attribute: # name: str - def read(self, __size: int) -> bytes: ... - def seek(self, __target: int, __whence: Literal[1]) -> object: ... + def read(self, size: int, /) -> bytes: ... + def seek(self, target: int, whence: Literal[1], /) -> object: ... class tzfile(_tzinfo): def __init__(self, fileobj: str | _TZFileReader, filename: str | None = None) -> None: ... diff --git a/stubs/python-xlib/Xlib/protocol/rq.pyi b/stubs/python-xlib/Xlib/protocol/rq.pyi index 5eb2f09c446b..e56cabd68053 100644 --- a/stubs/python-xlib/Xlib/protocol/rq.pyi +++ b/stubs/python-xlib/Xlib/protocol/rq.pyi @@ -347,7 +347,7 @@ class Struct: # Structs generate their attributes # TODO: Create a specific type-only class for all instances of `Struct` @type_check_only - def __getattr__(self, __name: str) -> Any: ... + def __getattr__(self, name: str, /) -> Any: ... class TextElements8(ValueField): string_textitem: Struct @@ -365,7 +365,7 @@ class GetAttrData: # GetAttrData classes get their attributes dynamically # TODO: Complete all classes inheriting from GetAttrData def __getattr__(self, attr: str) -> Any: ... - def __setattr__(self, __name: str, __value: Any) -> None: ... + def __setattr__(self, name: str, value: Any, /) -> None: ... class DictWrapper(GetAttrData): def __init__(self, dict: dict[str, Any]) -> None: ... diff --git a/stubs/redis/redis/cluster.pyi b/stubs/redis/redis/cluster.pyi index f43c1b3f405b..672eb3e059e1 100644 --- a/stubs/redis/redis/cluster.pyi +++ b/stubs/redis/redis/cluster.pyi @@ -250,7 +250,7 @@ class PipelineCommand: ) -> None: ... class _ParseResponseCallback(Protocol): - def __call__(self, __connection: Connection, __command: EncodableT, **kwargs: Incomplete) -> Any: ... + def __call__(self, connection: Connection, command: EncodableT, /, **kwargs: Incomplete) -> Any: ... class NodeCommands: parse_response: _ParseResponseCallback diff --git a/stubs/regex/regex/regex.pyi b/stubs/regex/regex/regex.pyi index 79778ce30dfc..2429744dee3a 100644 --- a/stubs/regex/regex/regex.pyi +++ b/stubs/regex/regex/regex.pyi @@ -593,11 +593,11 @@ class Match(Generic[AnyStr]): @property def fuzzy_changes(self) -> tuple[list[int], list[int], list[int]]: ... @overload - def group(self, __group: Literal[0] = 0) -> AnyStr: ... + def group(self, group: Literal[0] = 0, /) -> AnyStr: ... @overload - def group(self, __group: int | str = ...) -> AnyStr | Any: ... + def group(self, group: int | str = ..., /) -> AnyStr | Any: ... @overload - def group(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[AnyStr | Any, ...]: ... + def group(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[AnyStr | Any, ...]: ... @overload def groups(self, default: None = None) -> tuple[AnyStr | Any, ...]: ... @overload @@ -607,43 +607,43 @@ class Match(Generic[AnyStr]): @overload def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ... @overload - def span(self, __group: int | str = ...) -> tuple[int, int]: ... + def span(self, group: int | str = ..., /) -> tuple[int, int]: ... @overload - def span(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[tuple[int, int], ...]: ... + def span(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[tuple[int, int], ...]: ... @overload - def spans(self, __group: int | str = ...) -> list[tuple[int, int]]: ... + def spans(self, group: int | str = ..., /) -> list[tuple[int, int]]: ... @overload - def spans(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[tuple[int, int]], ...]: ... + def spans(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[tuple[int, int]], ...]: ... @overload - def start(self, __group: int | str = ...) -> int: ... + def start(self, group: int | str = ..., /) -> int: ... @overload - def start(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ... + def start(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[int, ...]: ... @overload - def starts(self, __group: int | str = ...) -> list[int]: ... + def starts(self, group: int | str = ..., /) -> list[int]: ... @overload - def starts(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ... + def starts(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[int], ...]: ... @overload - def end(self, __group: int | str = ...) -> int: ... + def end(self, group: int | str = ..., /) -> int: ... @overload - def end(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ... + def end(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[int, ...]: ... @overload - def ends(self, __group: int | str = ...) -> list[int]: ... + def ends(self, group: int | str = ..., /) -> list[int]: ... @overload - def ends(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ... + def ends(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[int], ...]: ... def expand(self, template: AnyStr) -> AnyStr: ... def expandf(self, format: AnyStr) -> AnyStr: ... @overload - def captures(self, __group: int | str = ...) -> list[AnyStr]: ... + def captures(self, group: int | str = ..., /) -> list[AnyStr]: ... @overload - def captures(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[AnyStr], ...]: ... + def captures(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[AnyStr], ...]: ... def capturesdict(self) -> dict[str, list[AnyStr]]: ... def detach_string(self) -> None: ... def allcaptures(self) -> tuple[list[AnyStr]]: ... def allspans(self) -> tuple[list[tuple[int, int]]]: ... @overload - def __getitem__(self, __key: Literal[0]) -> AnyStr: ... + def __getitem__(self, key: Literal[0], /) -> AnyStr: ... @overload - def __getitem__(self, __key: int | str) -> AnyStr | Any: ... + def __getitem__(self, key: int | str, /) -> AnyStr | Any: ... def __copy__(self) -> Self: ... def __deepcopy__(self) -> Self: ... if sys.version_info >= (3, 9): diff --git a/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi b/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi index fffca17c12f4..a0b1706eca1b 100644 --- a/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi +++ b/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi @@ -10,15 +10,15 @@ from requests.cookies import RequestsCookieJar _Token: TypeAlias = dict[str, Incomplete] # oauthlib.oauth2.Client.token class _AccessTokenResponseHook(Protocol): - def __call__(self, __response: requests.Response) -> requests.Response: ... + def __call__(self, response: requests.Response, /) -> requests.Response: ... class _RefreshTokenResponseHook(Protocol): - def __call__(self, __response: requests.Response) -> requests.Response: ... + def __call__(self, response: requests.Response, /) -> requests.Response: ... class _ProtectedRequestHook(Protocol): def __call__( - self, __url: Incomplete, __headers: Incomplete, __data: Incomplete - ) -> tuple[Incomplete, Incomplete, Incomplete]: ... + self, url: Incomplete, headers: Incomplete, data: Incomplete, + /) -> tuple[Incomplete, Incomplete, Incomplete]: ... class _ComplianceHooks(TypedDict): access_token_response: set[_AccessTokenResponseHook] diff --git a/stubs/requests/requests/structures.pyi b/stubs/requests/requests/structures.pyi index 8739ee493e74..53dd5f565154 100644 --- a/stubs/requests/requests/structures.pyi +++ b/stubs/requests/requests/structures.pyi @@ -18,7 +18,7 @@ class LookupDict(dict[str, _VT]): name: Any def __init__(self, name: Any = None) -> None: ... def __getitem__(self, key: str) -> _VT | None: ... # type: ignore[override] - def __setattr__(self, __attr: str, __value: _VT) -> None: ... + def __setattr__(self, attr: str, value: _VT, /) -> None: ... @overload def get(self, key: str, default: None = None) -> _VT | None: ... @overload diff --git a/stubs/seaborn/seaborn/_core/plot.pyi b/stubs/seaborn/seaborn/_core/plot.pyi index cfe70fc108bc..478203a50848 100644 --- a/stubs/seaborn/seaborn/_core/plot.pyi +++ b/stubs/seaborn/seaborn/_core/plot.pyi @@ -53,7 +53,7 @@ class ThemeConfig(mpl.RcParams): THEME_GROUPS: list[str] def __init__(self) -> None: ... def reset(self) -> None: ... - def update(self, __other: SupportsKeysAndGetItem[Incomplete, Incomplete] | None = None, **kwds: Incomplete) -> None: ... # type: ignore[override] + def update(self, other: SupportsKeysAndGetItem[Incomplete, Incomplete] | None = None, /, **kwds: Incomplete) -> None: ... # type: ignore[override] class DisplayConfig(TypedDict): format: Literal["png", "svg"] @@ -105,7 +105,7 @@ class Plot: engine: str | None | Default = ..., extent: tuple[float, float, float, float] | Default = ..., ) -> Plot: ... - def theme(self, __config: dict[str, Any]) -> Plot: ... + def theme(self, config: dict[str, Any], /) -> Plot: ... # Same signature as Plotter.save def save( self, diff --git a/stubs/six/six/__init__.pyi b/stubs/six/six/__init__.pyi index c2ae9c019b41..d8d3150fc262 100644 --- a/stubs/six/six/__init__.pyi +++ b/stubs/six/six/__init__.pyi @@ -16,8 +16,8 @@ from six import moves as moves # TODO: We should switch to the _typeshed version of SupportsGetItem # once mypy updates its vendored copy of typeshed and makes a new release class _SupportsGetItem(Protocol[_KT_contra, _VT_co]): - def __contains__(self, __x: Any) -> bool: ... - def __getitem__(self, __key: _KT_contra) -> _VT_co: ... + def __contains__(self, x: Any, /) -> bool: ... + def __getitem__(self, key: _KT_contra, /) -> _VT_co: ... _T = TypeVar("_T") _K = TypeVar("_K") diff --git a/stubs/tensorflow/tensorflow/data/__init__.pyi b/stubs/tensorflow/tensorflow/data/__init__.pyi index 97f33b057ddc..092516e6cfd5 100644 --- a/stubs/tensorflow/tensorflow/data/__init__.pyi +++ b/stubs/tensorflow/tensorflow/data/__init__.pyi @@ -146,14 +146,14 @@ class Dataset(ABC, Generic[_T1]): ) -> Dataset[tf.Tensor]: ... @staticmethod @overload - def range(__stop: ScalarTensorCompatible, output_type: DType = ..., name: str | None = None) -> Dataset[tf.Tensor]: ... + def range(stop: ScalarTensorCompatible, /, output_type: DType = ..., name: str | None = None) -> Dataset[tf.Tensor]: ... @staticmethod @overload def range( - __start: ScalarTensorCompatible, - __stop: ScalarTensorCompatible, - __step: ScalarTensorCompatible = 1, - output_type: DType = ..., + start: ScalarTensorCompatible, + stop: ScalarTensorCompatible, + step: ScalarTensorCompatible = 1, + /, output_type: DType = ..., name: str | None = None, ) -> Dataset[tf.Tensor]: ... def rebatch( diff --git a/stubs/tensorflow/tensorflow/keras/constraints.pyi b/stubs/tensorflow/tensorflow/keras/constraints.pyi index 12ba257cb66b..29e362ee2e35 100644 --- a/stubs/tensorflow/tensorflow/keras/constraints.pyi +++ b/stubs/tensorflow/tensorflow/keras/constraints.pyi @@ -6,7 +6,7 @@ from tensorflow import Tensor class Constraint: def get_config(self) -> dict[str, Any]: ... - def __call__(self, __w: Tensor) -> Tensor: ... + def __call__(self, w: Tensor, /) -> Tensor: ... @overload def get(identifier: None) -> None: ... diff --git a/stubs/tensorflow/tensorflow/keras/layers.pyi b/stubs/tensorflow/tensorflow/keras/layers.pyi index 4fa88ede01d8..8ac557a74028 100644 --- a/stubs/tensorflow/tensorflow/keras/layers.pyi +++ b/stubs/tensorflow/tensorflow/keras/layers.pyi @@ -56,15 +56,15 @@ class Layer(tf.Module, Generic[_InputT, _OutputT]): # First argument will automatically be cast to layer's compute dtype, but any other tensor arguments will not be. # Also various tensorflow tools/apis can misbehave if they encounter a layer with *args/**kwargs. def __call__(self, inputs: _InputT, *, training: bool = False, mask: TensorCompatible | None = None) -> _OutputT: ... - def call(self, __inputs: _InputT) -> _OutputT: ... + def call(self, inputs: _InputT, /) -> _OutputT: ... # input_shape's real type depends on _InputT, but we can't express that without HKT. # For example _InputT tf.Tensor -> tf.TensorShape, _InputT dict[str, tf.Tensor] -> dict[str, tf.TensorShape]. - def build(self, __input_shape: Any) -> None: ... + def build(self, input_shape: Any, /) -> None: ... @overload - def compute_output_shape(self: Layer[tf.Tensor, tf.Tensor], __input_shape: tf.TensorShape) -> tf.TensorShape: ... + def compute_output_shape(self: Layer[tf.Tensor, tf.Tensor], input_shape: tf.TensorShape, /) -> tf.TensorShape: ... @overload - def compute_output_shape(self, __input_shape: Any) -> Any: ... + def compute_output_shape(self, input_shape: Any, /) -> Any: ... def add_weight( self, name: str | None = None, diff --git a/stubs/tensorflow/tensorflow/keras/regularizers.pyi b/stubs/tensorflow/tensorflow/keras/regularizers.pyi index 5d35f6c3eefb..36262577fb93 100644 --- a/stubs/tensorflow/tensorflow/keras/regularizers.pyi +++ b/stubs/tensorflow/tensorflow/keras/regularizers.pyi @@ -8,7 +8,7 @@ class Regularizer: def get_config(self) -> dict[str, Any]: ... @classmethod def from_config(cls, config: dict[str, Any]) -> Self: ... - def __call__(self, __x: Tensor) -> Tensor: ... + def __call__(self, x: Tensor, /) -> Tensor: ... _Regularizer: TypeAlias = str | dict[str, Any] | Regularizer | None # noqa: Y047 diff --git a/stubs/tree-sitter/tree_sitter/binding.pyi b/stubs/tree-sitter/tree_sitter/binding.pyi index 30e988f8683c..5b07bfd55c9f 100644 --- a/stubs/tree-sitter/tree_sitter/binding.pyi +++ b/stubs/tree-sitter/tree_sitter/binding.pyi @@ -45,10 +45,10 @@ class Node: @property def type(self) -> str: ... def children_by_field_name(self, name: str) -> list[Node]: ... - def children_by_field_id(self, __id: int) -> list[Node]: ... - def field_name_for_child(self, __child_index: int) -> str: ... - def child_by_field_id(self, __id: int) -> Node | None: ... - def child_by_field_name(self, __name: str) -> Node | None: ... + def children_by_field_id(self, id: int, /) -> list[Node]: ... + def field_name_for_child(self, child_index: int, /) -> str: ... + def child_by_field_id(self, id: int, /) -> Node | None: ... + def child_by_field_name(self, name: str, /) -> Node | None: ... __hash__: ClassVar[None] # type: ignore[assignment] def sexp(self) -> str: ... def walk(self) -> TreeCursor: ... @@ -66,7 +66,7 @@ class Parser: # At runtime, Parser(1, 2, 3) ignores the arguments, but that's most likely buggy code def __init__(self) -> None: ... def parse(self, source: bytes, old_tree: Tree | None = None, keep_text: bool = True) -> Tree: ... - def set_language(self, __language: Language) -> None: ... + def set_language(self, language: Language, /) -> None: ... @final class Query: diff --git a/stubs/uWSGI/uwsgi.pyi b/stubs/uWSGI/uwsgi.pyi index 1b9380e778d4..00b7babb2efa 100644 --- a/stubs/uWSGI/uwsgi.pyi +++ b/stubs/uWSGI/uwsgi.pyi @@ -44,69 +44,69 @@ post_fork_hook = uwsgidecorators.postfork_chain_hook @final class SymbolsImporter: - def find_module(self, __fullname: str) -> Self | None: ... - def load_module(self, __fullname: str) -> ModuleType | None: ... + def find_module(self, fullname: str, /) -> Self | None: ... + def load_module(self, fullname: str, /) -> ModuleType | None: ... @final class SymbolsZipImporter: - def __init__(self, __name: str) -> None: ... - def find_module(self, __fullname: str) -> Self | None: ... - def load_module(self, __fullname: str) -> ModuleType | None: ... + def __init__(self, name: str, /) -> None: ... + def find_module(self, fullname: str, /) -> Self | None: ... + def load_module(self, fullname: str, /) -> ModuleType | None: ... @final class ZipImporter: - def __init__(self, __name: str) -> None: ... - def find_module(self, __fullname: str) -> Self | None: ... - def load_module(self, __fullname: str) -> ModuleType | None: ... + def __init__(self, name: str, /) -> None: ... + def find_module(self, fullname: str, /) -> Self | None: ... + def load_module(self, fullname: str, /) -> ModuleType | None: ... -def accepting(__accepting: bool = True) -> None: ... -def add_cron(__signum: int, __minute: int, __hour: int, __day: int, __month: int, __weekday: int) -> Literal[True]: ... -def add_file_monitor(__signum: int, __filename: str) -> None: ... -def add_rb_timer(__signum: int, __seconds: int, __iterations: int = 0) -> None: ... -def add_timer(__signum: int, __seconds: int) -> None: ... -def add_var(__key: bytes | str, __val: bytes | str) -> Literal[True]: ... -def alarm(__alarm: str, __msg: bytes | ReadOnlyBuffer | str) -> None: ... -def async_connect(__socket_name: str) -> int: ... -def async_sleep(__timeout: float) -> Literal[b""]: ... -def cache_clear(__cache_name: str = ...) -> _TrueOrNone: ... -def cache_dec(__key: str | bytes, __decrement: int = 1, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ... -def cache_del(__key: str | bytes, __cache_name: str = ...) -> _TrueOrNone: ... -def cache_div(__key: str | bytes, __divisor: int = 2, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ... -def cache_exists(__key: str | bytes, __cache_name: str = ...) -> _TrueOrNone: ... -def cache_get(__key: str | bytes, __cache_name: str = ...) -> bytes | None: ... -def cache_inc(__key: str | bytes, __increment: int = 1, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ... -def cache_keys(__cache_name: str = ...) -> list[bytes]: ... -def cache_mul(__key: str | bytes, __factor: int = 2, __expires: int = 0, __cache_name: str = ...) -> _TrueOrNone: ... -def cache_num(__key: str | bytes, __cache_name: str = ...) -> int: ... +def accepting(accepting: bool = True, /) -> None: ... +def add_cron(signum: int, minute: int, hour: int, day: int, month: int, weekday: int, /) -> Literal[True]: ... +def add_file_monitor(signum: int, filename: str, /) -> None: ... +def add_rb_timer(signum: int, seconds: int, iterations: int = 0, /) -> None: ... +def add_timer(signum: int, seconds: int, /) -> None: ... +def add_var(key: bytes | str, val: bytes | str, /) -> Literal[True]: ... +def alarm(alarm: str, msg: bytes | ReadOnlyBuffer | str, /) -> None: ... +def async_connect(socket_name: str, /) -> int: ... +def async_sleep(timeout: float, /) -> Literal[b""]: ... +def cache_clear(cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_dec(key: str | bytes, decrement: int = 1, expires: int = 0, cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_del(key: str | bytes, cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_div(key: str | bytes, divisor: int = 2, expires: int = 0, cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_exists(key: str | bytes, cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_get(key: str | bytes, cache_name: str = ..., /) -> bytes | None: ... +def cache_inc(key: str | bytes, increment: int = 1, expires: int = 0, cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_keys(cache_name: str = ..., /) -> list[bytes]: ... +def cache_mul(key: str | bytes, factor: int = 2, expires: int = 0, cache_name: str = ..., /) -> _TrueOrNone: ... +def cache_num(key: str | bytes, cache_name: str = ..., /) -> int: ... def cache_set( - __key: str | bytes, __value: str | bytes | ReadOnlyBuffer, __expires: int = 0, __cache_name: str = ... -) -> _TrueOrNone: ... + key: str | bytes, value: str | bytes | ReadOnlyBuffer, expires: int = 0, cache_name: str = ..., +/) -> _TrueOrNone: ... def cache_update( - __key: str | bytes, __value: str | bytes | ReadOnlyBuffer, __expires: int = 0, __cache_name: str = ... -) -> _TrueOrNone: ... -def queue_get(__index: int) -> bytes | None: ... -def queue_set(__index: int, __message: str | bytes | ReadOnlyBuffer) -> _TrueOrNone: ... + key: str | bytes, value: str | bytes | ReadOnlyBuffer, expires: int = 0, cache_name: str = ..., +/) -> _TrueOrNone: ... +def queue_get(index: int, /) -> bytes | None: ... +def queue_set(index: int, message: str | bytes | ReadOnlyBuffer, /) -> _TrueOrNone: ... @overload -def queue_last(__num: Literal[0] = 0) -> bytes | None: ... # type: ignore[overload-overlap] +def queue_last(num: Literal[0] = 0, /) -> bytes | None: ... # type: ignore[overload-overlap] @overload -def queue_last(__num: int) -> list[bytes | None]: ... -def queue_push(__message: str | bytes | ReadOnlyBuffer) -> _TrueOrNone: ... +def queue_last(num: int, /) -> list[bytes | None]: ... +def queue_push(message: str | bytes | ReadOnlyBuffer, /) -> _TrueOrNone: ... def queue_pull() -> bytes | None: ... def queue_pop() -> bytes | None: ... def queue_slot() -> int: ... def queue_pull_slot() -> int: ... -def snmp_set_community(__snmp_community: str) -> Literal[True]: ... -def snmp_set_counter32(__oid_num: int, __value: int) -> _TrueOrNone: ... -def snmp_set_counter64(__oid_num: int, __value: int) -> _TrueOrNone: ... -def snmp_set_gauge(__oid_num: int, __value: int) -> _TrueOrNone: ... -def snmp_incr_counter32(__oid_num: int, __increment: int) -> _TrueOrNone: ... -def snmp_incr_counter64(__oid_num: int, __increment: int) -> _TrueOrNone: ... -def snmp_incr_gauge(__oid_num: int, __increment: int) -> _TrueOrNone: ... -def snmp_decr_counter32(__oid_num: int, __decrement: int) -> _TrueOrNone: ... -def snmp_decr_counter64(__oid_num: int, __decrement: int) -> _TrueOrNone: ... -def snmp_decr_gauge(__oid_num: int, __decrement: int) -> _TrueOrNone: ... +def snmp_set_community(snmp_community: str, /) -> Literal[True]: ... +def snmp_set_counter32(oid_num: int, value: int, /) -> _TrueOrNone: ... +def snmp_set_counter64(oid_num: int, value: int, /) -> _TrueOrNone: ... +def snmp_set_gauge(oid_num: int, value: int, /) -> _TrueOrNone: ... +def snmp_incr_counter32(oid_num: int, increment: int, /) -> _TrueOrNone: ... +def snmp_incr_counter64(oid_num: int, increment: int, /) -> _TrueOrNone: ... +def snmp_incr_gauge(oid_num: int, increment: int, /) -> _TrueOrNone: ... +def snmp_decr_counter32(oid_num: int, decrement: int, /) -> _TrueOrNone: ... +def snmp_decr_counter64(oid_num: int, decrement: int, /) -> _TrueOrNone: ... +def snmp_decr_gauge(oid_num: int, decrement: int, /) -> _TrueOrNone: ... @overload -def send_to_spooler(__mesage_dict: dict[bytes, bytes]) -> bytes | None: ... +def send_to_spooler(mesage_dict: dict[bytes, bytes], /) -> bytes | None: ... @overload def send_to_spooler( *, spooler: bytes = ..., priority: bytes = ..., at: bytes = ..., body: bytes = ..., **kwargs: bytes @@ -114,127 +114,127 @@ def send_to_spooler( spool = send_to_spooler -def set_spooler_frequency(__frequency: int) -> Literal[True]: ... +def set_spooler_frequency(frequency: int, /) -> Literal[True]: ... def spooler_jobs() -> list[bytes]: ... def spooler_pid() -> int: ... def spooler_pids() -> list[int]: ... -def spooler_get_task(__task_path: str) -> dict[bytes, bytes] | None: ... -def call(__rpc_name: str, *args: bytes) -> bytes | None: ... -def chunked_read(__timeout: int = 0) -> bytes: ... +def spooler_get_task(task_path: str, /) -> dict[bytes, bytes] | None: ... +def call(rpc_name: str, /, *args: bytes) -> bytes | None: ... +def chunked_read(timeout: int = 0, /) -> bytes: ... def chunked_read_nb() -> bytes: ... def cl() -> int: ... -def close(__fd: int) -> None: ... -def connect(__socket_name: str, timeout: int = 0) -> int: ... +def close(fd: int, /) -> None: ... +def connect(socket_name: str, /, timeout: int = 0) -> int: ... def connection_fd() -> int: ... def disconnect() -> None: ... -def embedded_data(__name: str) -> bytes: ... -def extract(__name: str) -> bytes | None: ... +def embedded_data(name: str, /) -> bytes: ... +def extract(name: str, /) -> bytes | None: ... def farm_get_msg() -> bytes | None: ... -def farm_msg(__farm_name: str, __message: str | bytes | ReadOnlyBuffer) -> None: ... -def get_logvar(__key: str | bytes) -> bytes | None: ... +def farm_msg(farm_name: str, message: str | bytes | ReadOnlyBuffer, /) -> None: ... +def get_logvar(key: str | bytes, /) -> bytes | None: ... def green_schedule() -> Literal[True]: ... -def i_am_the_lord(__legion_name: str) -> bool: ... +def i_am_the_lord(legion_name: str, /) -> bool: ... def i_am_the_spooler() -> _TrueOrNone: ... -def in_farm(__farm_name: str = ...) -> _TrueOrNone: ... -def is_connected(__fd: int) -> bool: ... -def is_locked(__lock_num: int = 0) -> bool: ... -def listen_queue(__id: int = 0) -> int: ... -def lock(__lock_num: int = 0) -> None: ... -def log(__logline: str) -> Literal[True]: ... +def in_farm(farm_name: str = ..., /) -> _TrueOrNone: ... +def is_connected(fd: int, /) -> bool: ... +def is_locked(lock_num: int = 0, /) -> bool: ... +def listen_queue(id: int = 0, /) -> int: ... +def lock(lock_num: int = 0, /) -> None: ... +def log(logline: str, /) -> Literal[True]: ... def log_this_request() -> None: ... def logsize() -> int: ... -def lord_scroll(__legion_name: str) -> bytes | None: ... +def lord_scroll(legion_name: str, /) -> bytes | None: ... def masterpid() -> int: ... def mem() -> tuple[int, int]: ... -def metric_dec(__key: str, __decrement: int = 1) -> _TrueOrNone: ... -def metric_div(__key: str, __divisor: int = 1) -> _TrueOrNone: ... -def metric_get(__key: str) -> int: ... -def metric_inc(__key: str, __increment: int = 1) -> _TrueOrNone: ... -def metric_mul(__key: str, __factor: int = 1) -> _TrueOrNone: ... -def metric_set(__key: str, __value: int = 1) -> _TrueOrNone: ... -def metric_set_max(__key: str, __value: int = 1) -> _TrueOrNone: ... -def metric_set_min(__key: str, __value: int = 1) -> _TrueOrNone: ... +def metric_dec(key: str, decrement: int = 1, /) -> _TrueOrNone: ... +def metric_div(key: str, divisor: int = 1, /) -> _TrueOrNone: ... +def metric_get(key: str, /) -> int: ... +def metric_inc(key: str, increment: int = 1, /) -> _TrueOrNone: ... +def metric_mul(key: str, factor: int = 1, /) -> _TrueOrNone: ... +def metric_set(key: str, value: int = 1, /) -> _TrueOrNone: ... +def metric_set_max(key: str, value: int = 1, /) -> _TrueOrNone: ... +def metric_set_min(key: str, value: int = 1, /) -> _TrueOrNone: ... def micros() -> int: ... def mule_get_msg(signals: bool = True, farms: bool = True, buffer_size: int = 65536, timeout: int = -1) -> bytes: ... def mule_id() -> int: ... @overload -def mule_msg(__mesage: str | bytes | ReadOnlyBuffer) -> bool: ... +def mule_msg(mesage: str | bytes | ReadOnlyBuffer, /) -> bool: ... @overload -def mule_msg(__mesage: str | bytes | ReadOnlyBuffer, __mule_id: int) -> bool: ... +def mule_msg(mesage: str | bytes | ReadOnlyBuffer, mule_id: int, /) -> bool: ... @overload -def mule_msg(__mesage: str | bytes | ReadOnlyBuffer, __farm_name: str) -> bool: ... -def offload(__filename: str, __len: int = 0) -> Literal[b""]: ... -def parsefile(__filename: str) -> dict[bytes, bytes] | None: ... +def mule_msg(mesage: str | bytes | ReadOnlyBuffer, farm_name: str, /) -> bool: ... +def offload(filename: str, len: int = 0, /) -> Literal[b""]: ... +def parsefile(filename: str, /) -> dict[bytes, bytes] | None: ... def ready() -> _TrueOrNone: ... def ready_fd() -> int: ... -def recv(__fd: int, __max_size: int = 4096) -> bytes | None: ... +def recv(fd: int, max_size: int = 4096, /) -> bytes | None: ... @overload -def register_rpc(__name: str, __func: Callable[[], bytes | None]) -> Literal[True]: ... +def register_rpc(name: str, func: Callable[[], bytes | None], /) -> Literal[True]: ... @overload -def register_rpc(__name: str, __func: Callable[[bytes], bytes | None], arg_count: Literal[1]) -> Literal[True]: ... +def register_rpc(name: str, func: Callable[[bytes], bytes | None], /, arg_count: Literal[1]) -> Literal[True]: ... @overload -def register_rpc(__name: str, __func: Callable[[bytes, bytes], bytes | None], arg_count: Literal[2]) -> Literal[True]: ... +def register_rpc(name: str, func: Callable[[bytes, bytes], bytes | None], /, arg_count: Literal[2]) -> Literal[True]: ... @overload -def register_rpc(__name: str, __func: _RPCCallable, arg_count: int) -> Literal[True]: ... -def register_signal(__signum: int, __who: str, __handler: Callable[[int], Any]) -> None: ... +def register_rpc(name: str, func: _RPCCallable, /, arg_count: int) -> Literal[True]: ... +def register_signal(signum: int, who: str, handler: Callable[[int], Any], /) -> None: ... def reload() -> _TrueOrNone: ... def request_id() -> int: ... -def route(__router_name: str, __router_args: str) -> int: ... -def rpc(__node: str | bytes, __rpc_name: bytes, *rpc_args: bytes) -> bytes | None: ... +def route(router_name: str, router_args: str, /) -> int: ... +def rpc(node: str | bytes, rpc_name: bytes, /, *rpc_args: bytes) -> bytes | None: ... def rpc_list() -> tuple[bytes, ...]: ... -def scrolls(__legion_name: str) -> list[bytes] | None: ... +def scrolls(legion_name: str, /) -> list[bytes] | None: ... @overload -def send(__data: bytes) -> _TrueOrNone: ... +def send(data: bytes, /) -> _TrueOrNone: ... @overload -def send(__fd: int, __data: bytes) -> _TrueOrNone: ... +def send(fd: int, data: bytes, /) -> _TrueOrNone: ... def sendfile( - __filename_or_fd: str | bytes | int | HasFileno, __chunk: int = 0, __pos: int = 0, filesize: int = 0 + filename_or_fd: str | bytes | int | HasFileno, chunk: int = 0, pos: int = 0, /, filesize: int = 0 ) -> _TrueOrNone: ... -def set_logvar(__key: str | bytes, __val: str | bytes) -> None: ... -def set_user_harakiri(__seconds: int) -> None: ... -def set_warning_message(__message: str) -> Literal[True]: ... -def setprocname(__name: str) -> None: ... -def signal(__signum: int = ..., __node: str = ...) -> None: ... +def set_logvar(key: str | bytes, val: str | bytes, /) -> None: ... +def set_user_harakiri(seconds: int, /) -> None: ... +def set_warning_message(message: str, /) -> Literal[True]: ... +def setprocname(name: str, /) -> None: ... +def signal(signum: int = ..., node: str = ..., /) -> None: ... def signal_received() -> int: ... -def signal_registered(__signum: int) -> _TrueOrNone: ... -def signal_wait(__signum: int = ...) -> Literal[b""]: ... +def signal_registered(signum: int, /) -> _TrueOrNone: ... +def signal_wait(signum: int = ..., /) -> Literal[b""]: ... def start_response( - __status: str, __headers: list[tuple[str, str]], __exc_info: OptExcInfo | None = ... -) -> Callable[[bytes], None]: ... + status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., +/) -> Callable[[bytes], None]: ... def stop() -> _TrueOrNone: ... def suspend() -> Literal[True]: ... def total_requests() -> int: ... -def unlock(__lock_num: int = 0) -> None: ... -def wait_fd_read(__fd: int, __timeout: int = 0) -> Literal[b""]: ... -def wait_fd_write(__fd: int, __timeout: int = 0) -> Literal[b""]: ... -def websocket_handshake(__key: str | bytes = ..., __origin: str | bytes = ..., __proto: str | bytes = ...) -> None: ... +def unlock(lock_num: int = 0, /) -> None: ... +def wait_fd_read(fd: int, timeout: int = 0, /) -> Literal[b""]: ... +def wait_fd_write(fd: int, timeout: int = 0, /) -> Literal[b""]: ... +def websocket_handshake(key: str | bytes = ..., origin: str | bytes = ..., proto: str | bytes = ..., /) -> None: ... def websocket_recv() -> bytes: ... def websocket_recv_nb() -> bytes: ... def websocket_send(message: str | bytes | ReadOnlyBuffer) -> None: ... def websocket_send_binary(message: str | bytes | ReadOnlyBuffer) -> None: ... def worker_id() -> int: ... def workers() -> tuple[_WorkerDict, ...] | None: ... -def sharedarea_read(__id: int, __position: int, __length: int) -> bytes: ... -def sharedarea_write(__id: int, __position: int, __value: str | bytes | ReadOnlyBuffer) -> None: ... -def sharedarea_readbyte(__id: int, __position: int) -> int: ... -def sharedarea_writebyte(__id: int, __position: int, __value: int) -> None: ... -def sharedarea_read8(__id: int, __position: int) -> int: ... -def sharedarea_write8(__id: int, __position: int, __value: int) -> None: ... -def sharedarea_readlong(__id: int, __position: int) -> int: ... -def sharedarea_writelong(__id: int, __position: int, __value: int) -> None: ... -def sharedarea_read64(__id: int, __position: int) -> int: ... -def sharedarea_write64(__id: int, __position: int, __value: int) -> None: ... -def sharedarea_read32(__id: int, __position: int) -> int: ... -def sharedarea_write32(__id: int, __position: int, __value: int) -> None: ... -def sharedarea_read16(__id: int, __position: int) -> int: ... -def sharedarea_write16(__id: int, __position: int, __value: int) -> None: ... -def sharedarea_inclong(__id: int, __position: int, __increment: int = 1) -> None: ... -def sharedarea_inc64(__id: int, __position: int, __increment: int = 1) -> None: ... -def sharedarea_inc32(__id: int, __position: int, __increment: int = 1) -> None: ... -def sharedarea_dec64(__id: int, __position: int, __decrement: int = 1) -> None: ... -def sharedarea_dec32(__id: int, __position: int, __decrement: int = 1) -> None: ... -def sharedarea_rlock(__id: int) -> None: ... -def sharedarea_wlock(__id: int) -> None: ... -def sharedarea_unlock(__id: int) -> None: ... -def sharedarea_object(__id: int) -> bytearray: ... -def sharedarea_memoryview(__id: int) -> memoryview: ... +def sharedarea_read(id: int, position: int, length: int, /) -> bytes: ... +def sharedarea_write(id: int, position: int, value: str | bytes | ReadOnlyBuffer, /) -> None: ... +def sharedarea_readbyte(id: int, position: int, /) -> int: ... +def sharedarea_writebyte(id: int, position: int, value: int, /) -> None: ... +def sharedarea_read8(id: int, position: int, /) -> int: ... +def sharedarea_write8(id: int, position: int, value: int, /) -> None: ... +def sharedarea_readlong(id: int, position: int, /) -> int: ... +def sharedarea_writelong(id: int, position: int, value: int, /) -> None: ... +def sharedarea_read64(id: int, position: int, /) -> int: ... +def sharedarea_write64(id: int, position: int, value: int, /) -> None: ... +def sharedarea_read32(id: int, position: int, /) -> int: ... +def sharedarea_write32(id: int, position: int, value: int, /) -> None: ... +def sharedarea_read16(id: int, position: int, /) -> int: ... +def sharedarea_write16(id: int, position: int, value: int, /) -> None: ... +def sharedarea_inclong(id: int, position: int, increment: int = 1, /) -> None: ... +def sharedarea_inc64(id: int, position: int, increment: int = 1, /) -> None: ... +def sharedarea_inc32(id: int, position: int, increment: int = 1, /) -> None: ... +def sharedarea_dec64(id: int, position: int, decrement: int = 1, /) -> None: ... +def sharedarea_dec32(id: int, position: int, decrement: int = 1, /) -> None: ... +def sharedarea_rlock(id: int, /) -> None: ... +def sharedarea_wlock(id: int, /) -> None: ... +def sharedarea_unlock(id: int, /) -> None: ... +def sharedarea_object(id: int, /) -> bytearray: ... +def sharedarea_memoryview(id: int, /) -> memoryview: ... diff --git a/stubs/uWSGI/uwsgidecorators.pyi b/stubs/uWSGI/uwsgidecorators.pyi index 85767b979460..d344aea3b136 100644 --- a/stubs/uWSGI/uwsgidecorators.pyi +++ b/stubs/uWSGI/uwsgidecorators.pyi @@ -28,7 +28,7 @@ class postfork(Generic[_P, _T]): @overload def __init__(self: postfork[_P, _T], f: Callable[_P, _T]) -> None: ... @overload - def __call__(self, __f: Callable[_P2, _T2]) -> postfork[_P2, _T2]: ... + def __call__(self, f: Callable[_P2, _T2], /) -> postfork[_P2, _T2]: ... @overload def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ... @@ -73,7 +73,7 @@ class mulefunc(Generic[_P, _T]): def __init__(self: mulefunc[_P, _T], f: Callable[_P, _T]) -> None: ... def real_call(self, *args: _P.args, **kwargs: _P.kwargs) -> None: ... @overload - def __call__(self, __f: Callable[_P2, _T2]) -> mulefunc[_P2, _T2]: ... + def __call__(self, f: Callable[_P2, _T2], /) -> mulefunc[_P2, _T2]: ... @overload def __call__(self, *args: _P.args, **kwargs: _P.kwargs) -> _T: ... diff --git a/stubs/wurlitzer/wurlitzer.pyi b/stubs/wurlitzer/wurlitzer.pyi index f2b1c7fa5a01..642ffa4aca68 100644 --- a/stubs/wurlitzer/wurlitzer.pyi +++ b/stubs/wurlitzer/wurlitzer.pyi @@ -17,7 +17,7 @@ _StreamOutT = TypeVar("_StreamOutT", bound=_Stream[str] | _Stream[bytes]) _StreamErrT = TypeVar("_StreamErrT", bound=_Stream[str] | _Stream[bytes]) class _Stream(SupportsWrite[_T_contra], Protocol): - def seek(self, __offset: int, __whence: int = ...) -> int: ... + def seek(self, offset: int, whence: int = ..., /) -> int: ... # Alias for IPython.core.interactiveshell.InteractiveShell. # N.B. Even if we added ipython to the stub-uploader allowlist, diff --git a/stubs/zstd/zstd.pyi b/stubs/zstd/zstd.pyi index c5be08def03e..6cccf78141b1 100644 --- a/stubs/zstd/zstd.pyi +++ b/stubs/zstd/zstd.pyi @@ -2,16 +2,16 @@ from _typeshed import ReadableBuffer class Error(Exception): ... -def ZSTD_compress(__data: ReadableBuffer, __level: int = ..., __threads: int = ...) -> bytes: ... +def ZSTD_compress(data: ReadableBuffer, level: int = ..., threads: int = ..., /) -> bytes: ... def ZSTD_external() -> int: ... -def ZSTD_uncompress(__data: ReadableBuffer) -> bytes: ... +def ZSTD_uncompress(data: ReadableBuffer, /) -> bytes: ... def ZSTD_version() -> str: ... def ZSTD_version_number() -> int: ... def ZSTD_threads_count() -> int: ... def ZSTD_max_threads_count() -> int: ... -def compress(__data: ReadableBuffer, __level: int = ..., __threads: int = ...) -> bytes: ... -def decompress(__data: ReadableBuffer) -> bytes: ... -def dumps(__data: ReadableBuffer, __level: int = ..., __threads: int = ...) -> bytes: ... -def loads(__data: ReadableBuffer) -> bytes: ... -def uncompress(__data: ReadableBuffer) -> bytes: ... +def compress(data: ReadableBuffer, level: int = ..., threads: int = ..., /) -> bytes: ... +def decompress(data: ReadableBuffer, /) -> bytes: ... +def dumps(data: ReadableBuffer, level: int = ..., threads: int = ..., /) -> bytes: ... +def loads(data: ReadableBuffer, /) -> bytes: ... +def uncompress(data: ReadableBuffer, /) -> bytes: ... def version() -> str: ... From 20d60e4960c9ec796b62a6b24d8cac2b5cf7d580 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 9 Mar 2024 15:04:49 -0800 Subject: [PATCH 2/3] reformat --- stubs/WebOb/webob/acceptparse.pyi | 24 +++---- stubs/cffi/_cffi_backend.pyi | 6 +- stubs/gevent/gevent/_waiter.pyi | 4 +- stubs/greenlet/greenlet/_greenlet.pyi | 4 +- stubs/ibm-db/ibm_db.pyi | 67 +++++++++---------- stubs/mock/mock/mock.pyi | 4 +- stubs/paramiko/paramiko/client.pyi | 3 +- stubs/psycopg2/psycopg2/_psycopg.pyi | 10 +-- stubs/pyserial/serial/threaded/__init__.pyi | 4 +- .../requests_oauthlib/oauth2_session.pyi | 4 +- stubs/tensorflow/tensorflow/data/__init__.pyi | 3 +- stubs/uWSGI/uwsgi.pyi | 12 ++-- 12 files changed, 69 insertions(+), 76 deletions(-) diff --git a/stubs/WebOb/webob/acceptparse.pyi b/stubs/WebOb/webob/acceptparse.pyi index a7d0d01f14ea..56d5e585362c 100644 --- a/stubs/WebOb/webob/acceptparse.pyi +++ b/stubs/WebOb/webob/acceptparse.pyi @@ -224,14 +224,14 @@ class _AcceptCharsetProperty: def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload def __get__( - self, obj: Any, type: type | None = ..., - /) -> AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader: ... + self, obj: Any, type: type | None = ..., / + ) -> AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader: ... @overload def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload def __set__( - self, obj: Any, value: AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader, - /) -> None: ... + self, obj: Any, value: AcceptCharsetNoHeader | AcceptCharsetValidHeader | AcceptCharsetInvalidHeader, / + ) -> None: ... @overload def __set__(self, obj: Any, value: SupportsItems[str, float], /) -> None: ... @overload @@ -339,14 +339,14 @@ class _AcceptEncodingProperty: def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload def __get__( - self, obj: Any, type: type | None = ..., - /) -> AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader: ... + self, obj: Any, type: type | None = ..., / + ) -> AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader: ... @overload def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload def __set__( - self, obj: Any, value: AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader, - /) -> None: ... + self, obj: Any, value: AcceptEncodingNoHeader | AcceptEncodingValidHeader | AcceptEncodingInvalidHeader, / + ) -> None: ... @overload def __set__(self, obj: Any, value: SupportsItems[str, float], /) -> None: ... @overload @@ -486,14 +486,14 @@ class _AcceptLanguageProperty: def __get__(self, obj: None, type: type | None = ..., /) -> property: ... @overload def __get__( - self, obj: Any, type: type | None = ..., - /) -> AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader: ... + self, obj: Any, type: type | None = ..., / + ) -> AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader: ... @overload def __set__(self, obj: Any, value: str | None, /) -> None: ... @overload def __set__( - self, obj: Any, value: AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader, - /) -> None: ... + self, obj: Any, value: AcceptLanguageNoHeader | AcceptLanguageValidHeader | AcceptLanguageInvalidHeader, / + ) -> None: ... @overload def __set__(self, obj: Any, value: SupportsItems[str, float], /) -> None: ... @overload diff --git a/stubs/cffi/_cffi_backend.pyi b/stubs/cffi/_cffi_backend.pyi index ed1f0fcb6e8d..b192d7ed316e 100644 --- a/stubs/cffi/_cffi_backend.pyi +++ b/stubs/cffi/_cffi_backend.pyi @@ -213,7 +213,8 @@ def callback( python_callable: Callable[..., _T], error: Any = ..., onerror: Callable[[Exception, Any, Any], None] | None = ..., -/) -> Callable[..., _T]: ... + /, +) -> Callable[..., _T]: ... def cast(cdecl: CType, value: _CDataBase, /) -> _CDataBase: ... def complete_struct_or_union( cdecl: CType, @@ -223,7 +224,8 @@ def complete_struct_or_union( total_alignment: int, sflags: int, pack: int, -/) -> None: ... + /, +) -> None: ... @overload def from_buffer(cdecl: CType, python_buffer: ReadableBuffer, /, require_writable: Literal[False] = ...) -> _CDataBase: ... @overload diff --git a/stubs/gevent/gevent/_waiter.pyi b/stubs/gevent/gevent/_waiter.pyi index 6d8b70420997..23158d120c33 100644 --- a/stubs/gevent/gevent/_waiter.pyi +++ b/stubs/gevent/gevent/_waiter.pyi @@ -35,9 +35,7 @@ class Waiter(Generic[_T]): def exc_info(self) -> _ThrowArgs | None: ... def switch(self, value: _T) -> None: ... @overload - def throw( - self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, - /) -> None: ... + def throw(self, typ: type[BaseException], val: BaseException | object = None, tb: TracebackType | None = None, /) -> None: ... @overload def throw(self, typ: BaseException = ..., val: None = None, tb: TracebackType | None = None, /) -> None: ... def get(self) -> _T: ... diff --git a/stubs/greenlet/greenlet/_greenlet.pyi b/stubs/greenlet/greenlet/_greenlet.pyi index 11d46f847dc7..3e310a147790 100644 --- a/stubs/greenlet/greenlet/_greenlet.pyi +++ b/stubs/greenlet/greenlet/_greenlet.pyi @@ -47,8 +47,8 @@ class greenlet: def switch(self, *args: Any, **kwargs: Any) -> Any: ... @overload def throw( - self, typ: type[BaseException] = ..., val: BaseException | object = None, tb: TracebackType | None = None, - /) -> Any: ... + self, typ: type[BaseException] = ..., val: BaseException | object = None, tb: TracebackType | None = None, / + ) -> Any: ... @overload def throw(self, typ: BaseException = ..., val: None = None, tb: TracebackType | None = None, /) -> Any: ... def __bool__(self) -> bool: ... diff --git a/stubs/ibm-db/ibm_db.pyi b/stubs/ibm-db/ibm_db.pyi index 039780646bf4..3840582334f6 100644 --- a/stubs/ibm-db/ibm_db.pyi +++ b/stubs/ibm-db/ibm_db.pyi @@ -227,7 +227,8 @@ def bind_param( precision: int | None = ..., scale: int | None = ..., size: int | None = ..., -/) -> bool: ... + /, +) -> bool: ... @overload def callproc(connection: IBM_DBConnection, procname: str, /) -> IBM_DBStatement | None: ... @overload @@ -241,36 +242,34 @@ def column_privileges( schema: str | None = ..., table_name: str | None = ..., column_name: str | None = ..., -/) -> IBM_DBStatement: ... + /, +) -> IBM_DBStatement: ... def columns( connection: IBM_DBConnection, qualifier: str | None = ..., schema: str | None = ..., table_name: str | None = ..., column_name: str | None = ..., -/) -> IBM_DBStatement: ... + /, +) -> IBM_DBStatement: ... def commit(connection: IBM_DBConnection, /) -> bool: ... def conn_error(connection: IBM_DBConnection | None = ..., /) -> str: ... def conn_errormsg(connection: IBM_DBConnection | None = ..., /) -> str: ... def conn_warn(connection: IBM_DBConnection | None = ..., /) -> str: ... def connect( - database: str, - user: str, - password: str, - options: dict[int, int | str] | None = ..., - replace_quoted_literal: int = ..., -/) -> IBM_DBConnection | None: ... + database: str, user: str, password: str, options: dict[int, int | str] | None = ..., replace_quoted_literal: int = ..., / +) -> IBM_DBConnection | None: ... def createdb(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ... def createdbNX(connection: IBM_DBConnection, dbName: str, codeSet: str = ..., mode: str = ..., /) -> bool: ... def cursor_type(stmt: IBM_DBStatement, /) -> int: ... def dropdb(connection: IBM_DBConnection, dbName: str, /) -> bool: ... def exec_immediate( - connection: IBM_DBConnection, statement: str | None, options: dict[int, int] = ..., -/) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, statement: str | None, options: dict[int, int] = ..., / +) -> IBM_DBStatement | bool: ... def execute(stmt: IBM_DBStatement, parameters: tuple[object, ...] | None = ..., /) -> bool: ... def execute_many( - stmt: IBM_DBStatement, seq_of_parameters: tuple[object, ...], options: dict[int, int] = ..., -/) -> int | None: ... + stmt: IBM_DBStatement, seq_of_parameters: tuple[object, ...], options: dict[int, int] = ..., / +) -> int | None: ... def fetch_assoc(stmt: IBM_DBStatement, row_number: int = ..., /) -> dict[str, object] | bool: ... def fetch_both(stmt: IBM_DBStatement, row_number: int = ..., /) -> dict[int | str, object] | bool: ... def fetch_row(stmt: IBM_DBStatement, row_number: int = ..., /) -> bool: ... @@ -291,7 +290,8 @@ def foreign_keys( fk_qualifier: str | None = ..., fk_schema: str | None = ..., fk_table_name: str | None = ..., -/) -> IBM_DBStatement: ... + /, +) -> IBM_DBStatement: ... def free_result(stmt: IBM_DBStatement, /) -> bool: ... def free_stmt(stmt: IBM_DBStatement, /) -> bool: ... def get_db_info(connection: IBM_DBConnection, option: int, /) -> str | bool: ... @@ -302,45 +302,42 @@ def next_result(stmt: IBM_DBStatement, /) -> IBM_DBStatement | bool: ... def num_fields(stmt: IBM_DBStatement, /) -> int | bool: ... def num_rows(stmt: IBM_DBStatement, /) -> int: ... def pconnect( - database: str, username: str, password: str, options: dict[int, int | str] | None = ..., -/) -> IBM_DBConnection | None: ... + database: str, username: str, password: str, options: dict[int, int | str] | None = ..., / +) -> IBM_DBConnection | None: ... def prepare( - connection: IBM_DBConnection, statement: str, options: dict[int, int | str] | None = ..., -/) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, statement: str, options: dict[int, int | str] | None = ..., / +) -> IBM_DBStatement | bool: ... def primary_keys( - connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, -/) -> IBM_DBStatement: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, / +) -> IBM_DBStatement: ... def procedure_columns( - connection: IBM_DBConnection, - qualifier: str | None, - schema: str | None, - procedure: str | None, - parameter: str | None, -/) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, procedure: str | None, parameter: str | None, / +) -> IBM_DBStatement | bool: ... def procedures( - connection: IBM_DBConnection, qualifier: str | None, schema: str | None, procedure: str | None, -/) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, procedure: str | None, / +) -> IBM_DBStatement | bool: ... def recreatedb(connection: IBM_DBConnection, dbName: str, codeSet: str | None = ..., mode: str | None = ..., /) -> bool: ... def result(stmt: IBM_DBStatement, column: int | str, /) -> Any: ... def rollback(connection: IBM_DBConnection, /) -> bool: ... def server_info(connection: IBM_DBConnection, /) -> IBM_DBServerInfo | bool: ... def set_option(resc: IBM_DBConnection | IBM_DBStatement, options: dict[int, int | str], type: int, /) -> bool: ... def special_columns( - connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, scope: int, -/) -> IBM_DBStatement: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, scope: int, / +) -> IBM_DBStatement: ... def statistics( - connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, unique: bool | None, -/) -> IBM_DBStatement: ... + connection: IBM_DBConnection, qualifier: str | None, schema: str | None, table_name: str | None, unique: bool | None, / +) -> IBM_DBStatement: ... def stmt_error(stmt: IBM_DBStatement = ..., /) -> str: ... def stmt_errormsg(stmt: IBM_DBStatement = ..., /) -> str: ... def stmt_warn(connection: IBM_DBConnection = ..., /) -> IBM_DBStatement: ... def table_privileges( - connection: IBM_DBConnection, qualifier: str | None = ..., schema: str | None = ..., table_name: str | None = ..., -/) -> IBM_DBStatement | bool: ... + connection: IBM_DBConnection, qualifier: str | None = ..., schema: str | None = ..., table_name: str | None = ..., / +) -> IBM_DBStatement | bool: ... def tables( connection: IBM_DBConnection, qualifier: str | None = ..., schema: str | None = ..., table_name: str | None = ..., table_type: str | None = ..., -/) -> IBM_DBStatement | bool: ... + /, +) -> IBM_DBStatement | bool: ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 6106426c6ee1..65b3804a79d4 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -204,8 +204,8 @@ class _patch(Generic[_T]): is_local: bool def __enter__(self) -> _T: ... def __exit__( - self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, - /) -> None: ... + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, / + ) -> None: ... def start(self) -> _T: ... def stop(self) -> None: ... diff --git a/stubs/paramiko/paramiko/client.pyi b/stubs/paramiko/paramiko/client.pyi index e6aae362f742..3790318154d8 100644 --- a/stubs/paramiko/paramiko/client.pyi +++ b/stubs/paramiko/paramiko/client.pyi @@ -13,7 +13,8 @@ class _TransportFactory(Protocol): def __call__( self, sock: _SocketLike, - /, *, + /, + *, gss_kex: bool, gss_deleg_creds: bool, disabled_algorithms: Mapping[str, Iterable[str]] | None, diff --git a/stubs/psycopg2/psycopg2/_psycopg.pyi b/stubs/psycopg2/psycopg2/_psycopg.pyi index f80e741cbb7c..a6e3591cf3cc 100644 --- a/stubs/psycopg2/psycopg2/_psycopg.pyi +++ b/stubs/psycopg2/psycopg2/_psycopg.pyi @@ -577,14 +577,8 @@ def Time(hour: int, minutes: int, seconds: float, tzinfo: dt.tzinfo | None = Non def TimeFromPy(time: dt.time, /) -> _datetime: ... def TimeFromTicks(ticks: float, /) -> _datetime: ... def Timestamp( - year: int, - month: int, - day: int, - hour: int = 0, - minutes: int = 0, - seconds: float = 0, - tzinfo: dt.tzinfo | None = None, -/) -> _datetime: ... + year: int, month: int, day: int, hour: int = 0, minutes: int = 0, seconds: float = 0, tzinfo: dt.tzinfo | None = None, / +) -> _datetime: ... def TimestampFromPy(datetime: dt.datetime, /) -> _datetime: ... def TimestampFromTicks(ticks: float, /) -> _datetime: ... def _connect(*args, **kwargs): ... diff --git a/stubs/pyserial/serial/threaded/__init__.pyi b/stubs/pyserial/serial/threaded/__init__.pyi index 8eb04014b3f4..022338f54ee7 100644 --- a/stubs/pyserial/serial/threaded/__init__.pyi +++ b/stubs/pyserial/serial/threaded/__init__.pyi @@ -44,5 +44,5 @@ class ReaderThread(threading.Thread): def connect(self) -> tuple[Self, Protocol]: ... def __enter__(self) -> Protocol: ... def __exit__( - self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, - /) -> None: ... + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None, / + ) -> None: ... diff --git a/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi b/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi index a0b1706eca1b..be380900d91b 100644 --- a/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi +++ b/stubs/requests-oauthlib/requests_oauthlib/oauth2_session.pyi @@ -17,8 +17,8 @@ class _RefreshTokenResponseHook(Protocol): class _ProtectedRequestHook(Protocol): def __call__( - self, url: Incomplete, headers: Incomplete, data: Incomplete, - /) -> tuple[Incomplete, Incomplete, Incomplete]: ... + self, url: Incomplete, headers: Incomplete, data: Incomplete, / + ) -> tuple[Incomplete, Incomplete, Incomplete]: ... class _ComplianceHooks(TypedDict): access_token_response: set[_AccessTokenResponseHook] diff --git a/stubs/tensorflow/tensorflow/data/__init__.pyi b/stubs/tensorflow/tensorflow/data/__init__.pyi index 092516e6cfd5..430070d8d6ab 100644 --- a/stubs/tensorflow/tensorflow/data/__init__.pyi +++ b/stubs/tensorflow/tensorflow/data/__init__.pyi @@ -153,7 +153,8 @@ class Dataset(ABC, Generic[_T1]): start: ScalarTensorCompatible, stop: ScalarTensorCompatible, step: ScalarTensorCompatible = 1, - /, output_type: DType = ..., + /, + output_type: DType = ..., name: str | None = None, ) -> Dataset[tf.Tensor]: ... def rebatch( diff --git a/stubs/uWSGI/uwsgi.pyi b/stubs/uWSGI/uwsgi.pyi index 00b7babb2efa..d42c32b30074 100644 --- a/stubs/uWSGI/uwsgi.pyi +++ b/stubs/uWSGI/uwsgi.pyi @@ -79,11 +79,11 @@ def cache_keys(cache_name: str = ..., /) -> list[bytes]: ... def cache_mul(key: str | bytes, factor: int = 2, expires: int = 0, cache_name: str = ..., /) -> _TrueOrNone: ... def cache_num(key: str | bytes, cache_name: str = ..., /) -> int: ... def cache_set( - key: str | bytes, value: str | bytes | ReadOnlyBuffer, expires: int = 0, cache_name: str = ..., -/) -> _TrueOrNone: ... + key: str | bytes, value: str | bytes | ReadOnlyBuffer, expires: int = 0, cache_name: str = ..., / +) -> _TrueOrNone: ... def cache_update( - key: str | bytes, value: str | bytes | ReadOnlyBuffer, expires: int = 0, cache_name: str = ..., -/) -> _TrueOrNone: ... + key: str | bytes, value: str | bytes | ReadOnlyBuffer, expires: int = 0, cache_name: str = ..., / +) -> _TrueOrNone: ... def queue_get(index: int, /) -> bytes | None: ... def queue_set(index: int, message: str | bytes | ReadOnlyBuffer, /) -> _TrueOrNone: ... @overload @@ -199,8 +199,8 @@ def signal_received() -> int: ... def signal_registered(signum: int, /) -> _TrueOrNone: ... def signal_wait(signum: int = ..., /) -> Literal[b""]: ... def start_response( - status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., -/) -> Callable[[bytes], None]: ... + status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., / +) -> Callable[[bytes], None]: ... def stop() -> _TrueOrNone: ... def suspend() -> Literal[True]: ... def total_requests() -> int: ... From a13981d45aef0bf217ea3ff5d1ce056f4377bca4 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 9 Mar 2024 15:11:04 -0800 Subject: [PATCH 3/3] I don't know what webob is doing --- stubs/WebOb/webob/dec.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/WebOb/webob/dec.pyi b/stubs/WebOb/webob/dec.pyi index 5379a4f02e48..40e966c3d1b7 100644 --- a/stubs/WebOb/webob/dec.pyi +++ b/stubs/WebOb/webob/dec.pyi @@ -151,9 +151,9 @@ class _unbound_wsgify(wsgify[_RequestT_contra, _P], Generic[_RequestT_contra, _P @overload def __call__(self, __self: _S, func: _RequestHandler[_RequestT_contra, _P], /) -> Self: ... @overload - def __call__(self, self: _S, /, req: _RequestT_contra) -> _AnyResponse: ... + def __call__(self, __self: _S, /, req: _RequestT_contra) -> _AnyResponse: ... @overload - def __call__(self, self: _S, /, req: _RequestT_contra, *args: _P.args, **kw: _P.kwargs) -> _AnyResponse: ... + def __call__(self, __self: _S, /, req: _RequestT_contra, *args: _P.args, **kw: _P.kwargs) -> _AnyResponse: ... class _UnboundMiddleware(Generic[_RequestT_contra, _AppT_contra, _P]): wrapper_class: type[wsgify[_RequestT_contra, Concatenate[_AppT_contra, _P]]]