From 0c7bdffa900c862161e40d5e8c190076e493a98b Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Thu, 9 Nov 2023 22:40:10 -0800 Subject: [PATCH] third-party: make some protocol params pos-only (#11006) --- stubs/Pillow/PIL/ImageFont.pyi | 2 +- stubs/Pillow/PIL/ImageOps.pyi | 2 +- stubs/Pillow/PIL/_imaging.pyi | 8 ++++---- stubs/WTForms/wtforms/form.pyi | 4 ++-- stubs/WebOb/webob/exc.pyi | 2 +- stubs/bleach/bleach/callbacks.pyi | 2 +- stubs/click-spinner/click_spinner/__init__.pyi | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/stubs/Pillow/PIL/ImageFont.pyi b/stubs/Pillow/PIL/ImageFont.pyi index 605f4f4cb..a331dd492 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 c9f4f0275..58beed0d0 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, cutoff: int = 0, ignore: int | None = None, mask: Image | None = None, preserve_tone: bool = False diff --git a/stubs/Pillow/PIL/_imaging.pyi b/stubs/Pillow/PIL/_imaging.pyi index 2e523f7d2..4cb18612b 100644 --- a/stubs/Pillow/PIL/_imaging.pyi +++ b/stubs/Pillow/PIL/_imaging.pyi @@ -18,10 +18,10 @@ 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: ... diff --git a/stubs/WTForms/wtforms/form.pyi b/stubs/WTForms/wtforms/form.pyi index bfb81c72b..6d1ff0c5b 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/WebOb/webob/exc.pyi b/stubs/WebOb/webob/exc.pyi index b662ea0ff..26a5236c1 100644 --- a/stubs/WebOb/webob/exc.pyi +++ b/stubs/WebOb/webob/exc.pyi @@ -8,7 +8,7 @@ from typing_extensions import Literal, Self from webob.response import Response class _JSONFormatter(Protocol): - def __call__(self, body: str, status: str, title: str, environ: WSGIEnvironment) -> str: ... + def __call__(self, *, body: str, status: str, title: str, environ: WSGIEnvironment) -> str: ... class HTTPException(Exception): wsgi_response: Response diff --git a/stubs/bleach/bleach/callbacks.pyi b/stubs/bleach/bleach/callbacks.pyi index 7529d620a..ff632caf0 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/click-spinner/click_spinner/__init__.pyi b/stubs/click-spinner/click_spinner/__init__.pyi index 6a68a5f40..1f280c63b 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]