Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve turtle callbacks #8200

Merged
merged 1 commit into from
Jun 28, 2022
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
26 changes: 13 additions & 13 deletions stdlib/turtle.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ class TurtleScreen(TurtleScreenBase):
def window_height(self) -> int: ...
def getcanvas(self) -> Canvas: ...
def getshapes(self) -> list[str]: ...
def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
def onkey(self, fun: Callable[[], Any], key: str) -> None: ...
def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
def onkey(self, fun: Callable[[], object], key: str) -> None: ...
def listen(self, xdummy: float | None = ..., ydummy: float | None = ...) -> None: ...
def ontimer(self, fun: Callable[[], Any], t: int = ...) -> None: ...
def ontimer(self, fun: Callable[[], object], t: int = ...) -> None: ...
@overload
def bgpic(self, picname: None = ...) -> str: ...
@overload
Expand All @@ -238,7 +238,7 @@ class TurtleScreen(TurtleScreenBase):
resetscreen = reset
clearscreen = clear
addshape = register_shape
def onkeypress(self, fun: Callable[[], Any], key: str | None = ...) -> None: ...
def onkeypress(self, fun: Callable[[], object], key: str | None = ...) -> None: ...
onkeyrelease = onkey

class TNavigator:
Expand Down Expand Up @@ -409,9 +409,9 @@ class RawTurtle(TPen, TNavigator):
def getscreen(self) -> TurtleScreen: ...
def getturtle(self: Self) -> Self: ...
getpen = getturtle
def onclick(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ...
def onrelease(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ...
def ondrag(self, fun: Callable[[float, float], Any], btn: int = ..., add: bool | None = ...) -> None: ...
def onclick(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ...
def onrelease(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ...
def ondrag(self, fun: Callable[[float, float], object], btn: int = ..., add: bool | None = ...) -> None: ...
def undo(self) -> None: ...
turtlesize = shapesize

Expand Down Expand Up @@ -490,10 +490,10 @@ def window_width() -> int: ...
def window_height() -> int: ...
def getcanvas() -> Canvas: ...
def getshapes() -> list[str]: ...
def onclick(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
def onkey(fun: Callable[[], Any], key: str) -> None: ...
def onclick(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
def onkey(fun: Callable[[], object], key: str) -> None: ...
def listen(xdummy: float | None = ..., ydummy: float | None = ...) -> None: ...
def ontimer(fun: Callable[[], Any], t: int = ...) -> None: ...
def ontimer(fun: Callable[[], object], t: int = ...) -> None: ...
@overload
def bgpic(picname: None = ...) -> str: ...
@overload
Expand All @@ -508,7 +508,7 @@ resetscreen = reset
clearscreen = clear
addshape = register_shape

def onkeypress(fun: Callable[[], Any], key: str | None = ...) -> None: ...
def onkeypress(fun: Callable[[], object], key: str | None = ...) -> None: ...

onkeyrelease = onkey

Expand Down Expand Up @@ -680,8 +680,8 @@ def getturtle() -> Turtle: ...

getpen = getturtle

def onrelease(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
def ondrag(fun: Callable[[float, float], Any], btn: int = ..., add: Any | None = ...) -> None: ...
def onrelease(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
def ondrag(fun: Callable[[float, float], object], btn: int = ..., add: Any | None = ...) -> None: ...
def undo() -> None: ...

turtlesize = shapesize
Expand Down