mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
third-party: make some protocol params pos-only (#11006)
This commit is contained in:
@@ -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, cutoff: int = 0, ignore: int | None = None, mask: Image | None = None, preserve_tone: bool = False
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user