Merge remote-tracking branch 'origin/typing' into typing

This commit is contained in:
AsfhtgkDavid 2025-01-25 22:36:54 +02:00
commit de17499b95
2 changed files with 10 additions and 4 deletions

View File

@ -39,7 +39,7 @@ from typing import TYPE_CHECKING, Any, AnyStr, Callable, Union, cast, Literal
from . import Image, ImageColor
from ._deprecate import deprecate
from ._typing import Coords, Anchor, Align, Direction
from ._typing import Align, Anchor, Coords, Direction
# experimental access to the outline API
Outline: Callable[[], Image.core._Outline] | None
@ -241,7 +241,7 @@ class ImageDraw:
xy: Coords,
fill: _Ink | None = None,
width: int = 0,
joint: Literal["curve"] | None = None,
joint: Literal[curve] | None = None,
) -> None:
"""Draw a line, or a connected sequence of line segments."""
ink = self._getink(fill)[0]

View File

@ -3,7 +3,7 @@ from __future__ import annotations
import os
import sys
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, Protocol, TypeVar, Union, Literal
from typing import TYPE_CHECKING, Any, Literal, Protocol, TypeVar, Union
if TYPE_CHECKING:
from numbers import _IntegralLike as IntegralLike
@ -51,7 +51,13 @@ StrOrBytesPath = Union[str, bytes, os.PathLike[str], os.PathLike[bytes]]
horizontal_anchors = ("l", "m", "r", "s")
vertical_anchors = ("a", "t", "m", "s", "b", "d")
Anchor = Literal[*(horizontal_anchor + vertical_anchor for horizontal_anchor in horizontal_anchors for vertical_anchor in vertical_anchors)]
Anchor = Literal[
*(
horizontal_anchor + vertical_anchor
for horizontal_anchor in horizontal_anchors
for vertical_anchor in vertical_anchors
)
]
Align = Literal["left", "center", "right"]