mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-24 17:28:40 +08:00
Use PEP 570 syntax in third party stubs (#11554)
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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=...): ...
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user