third-party: make some protocol params pos-only (#11006)

This commit is contained in:
Jelle Zijlstra
2023-11-09 22:40:10 -08:00
committed by GitHub
parent 4deef7550f
commit 0c7bdffa90
7 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -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=...): ...
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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: ...