Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions stdlib/turtle.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,20 @@ class Terminator(Exception): ...
class TurtleGraphicsError(Exception): ...

class Shape:
def __init__(self, type_: str, data: _PolygonCoords | PhotoImage | None = None) -> None: ...
def __init__(
self, type_: Literal["polygon", "image", "compound"], data: _PolygonCoords | PhotoImage | None = None
) -> None: ...
def addcomponent(self, poly: _PolygonCoords, fill: _Color, outline: _Color | None = None) -> None: ...

class TurtleScreen(TurtleScreenBase):
def __init__(self, cv: Canvas, mode: str = "standard", colormode: float = 1.0, delay: int = 10) -> None: ...
def __init__(
self, cv: Canvas, mode: Literal["standard", "logo", "world"] = "standard", colormode: float = 1.0, delay: int = 10
) -> None: ...
def clear(self) -> None: ...
@overload
def mode(self, mode: None = None) -> str: ...
@overload
def mode(self, mode: str) -> None: ...
def mode(self, mode: Literal["standard", "logo", "world"]) -> None: ...
def setworldcoordinates(self, llx: float, lly: float, urx: float, ury: float) -> None: ...
def register_shape(self, name: str, shape: _PolygonCoords | Shape | None = None) -> None: ...
@overload
Expand Down Expand Up @@ -289,7 +293,7 @@ class TNavigator:
DEFAULT_MODE: str
DEFAULT_ANGLEOFFSET: int
DEFAULT_ANGLEORIENT: int
def __init__(self, mode: str = "standard") -> None: ...
def __init__(self, mode: Literal["standard", "logo", "world"] = "standard") -> None: ...
def reset(self) -> None: ...
def degrees(self, fullcircle: float = 360.0) -> None: ...
def radians(self) -> None: ...
Expand Down Expand Up @@ -333,11 +337,11 @@ class TNavigator:
seth = setheading

class TPen:
def __init__(self, resizemode: str = "noresize") -> None: ...
def __init__(self, resizemode: Literal["auto", "user", "noresize"] = "noresize") -> None: ...
@overload
def resizemode(self, rmode: None = None) -> str: ...
@overload
def resizemode(self, rmode: str) -> None: ...
def resizemode(self, rmode: Literal["auto", "user", "noresize"]) -> None: ...
@overload
def pensize(self, width: None = None) -> int: ...
@overload
Expand Down Expand Up @@ -389,7 +393,7 @@ class TPen:
fillcolor: _Color = ...,
pensize: int = ...,
speed: int = ...,
resizemode: str = ...,
resizemode: Literal["auto", "user", "noresize"] = ...,
stretchfactor: tuple[float, float] = ...,
outline: int = ...,
tilt: float = ...,
Expand Down Expand Up @@ -524,7 +528,7 @@ def clear() -> None: ...
@overload
def mode(mode: None = None) -> str: ...
@overload
def mode(mode: str) -> None: ...
def mode(mode: Literal["standard", "logo", "world"]) -> None: ...
def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ...
def register_shape(name: str, shape: _PolygonCoords | Shape | None = None) -> None: ...
@overload
Expand Down Expand Up @@ -634,7 +638,7 @@ seth = setheading
@overload
def resizemode(rmode: None = None) -> str: ...
@overload
def resizemode(rmode: str) -> None: ...
def resizemode(rmode: Literal["auto", "user", "noresize"]) -> None: ...
@overload
def pensize(width: None = None) -> int: ...
@overload
Expand Down Expand Up @@ -683,7 +687,7 @@ def pen(
fillcolor: _Color = ...,
pensize: int = ...,
speed: int = ...,
resizemode: str = ...,
resizemode: Literal["auto", "user", "noresize"] = ...,
stretchfactor: tuple[float, float] = ...,
outline: int = ...,
tilt: float = ...,
Expand Down