Skip to content

Commit

Permalink
Extend PenState dict in turtle
Browse files Browse the repository at this point in the history
  • Loading branch information
kbaikov committed Nov 28, 2024
1 parent 02533d1 commit d2ac985
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions stdlib/turtle.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from collections.abc import Callable, Sequence
from tkinter import Canvas, Frame, Misc, PhotoImage, Scrollbar
from typing import Any, ClassVar, overload
from typing import Any, ClassVar, Literal, TypedDict, overload
from typing_extensions import Self, TypeAlias

__all__ = [
Expand Down Expand Up @@ -141,8 +141,18 @@ if sys.version_info < (3, 13):
_Color: TypeAlias = str | tuple[float, float, float]
_AnyColor: TypeAlias = Any

# TODO: Replace this with a TypedDict once it becomes standardized.
_PenState: TypeAlias = dict[str, Any]
class _PenState(TypedDict):
shown: bool
pendown: bool
pencolor: _Color
fillcolor: _Color
pensize: int
speed: int
resizemode: Literal["auto", "user", "noresize"]
stretchfactor: tuple[float, float]
shearfactor: float
outline: int
tilt: float

_Speed: TypeAlias = str | float
_PolygonCoords: TypeAlias = Sequence[tuple[float, float]]
Expand Down

0 comments on commit d2ac985

Please sign in to comment.