From a68fb507889062601d345a28e95fb5dc0cec1e0b Mon Sep 17 00:00:00 2001 From: krouziciorel Date: Fri, 19 Mar 2021 10:10:28 +0000 Subject: [PATCH] turtle.pyi: Add functions copied from _Screen (#5104) The turtle module re-exports methods of its classes as top-level functions. Typeshed includes most of these, but `exitonclick` and others from the `_Screen` class were missing. Add them. Co-authored-by: Petr Viktorin --- stdlib/turtle.pyi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index eee601823..a44b25926 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -295,8 +295,6 @@ class _Screen(TurtleScreen): def bye(self) -> None: ... def exitonclick(self) -> None: ... -def Screen() -> _Screen: ... - class Turtle(RawTurtle): def __init__(self, shape: str = ..., undobuffersize: int = ..., visible: bool = ...) -> None: ... @@ -381,6 +379,14 @@ if sys.version_info >= (3,): def onkeypress(fun: Callable[[], Any], key: Optional[str] = ...) -> None: ... onkeyrelease = onkey +# Functions copied from _Screen: + +def setup(width: float = ..., height: float = ..., startx: Optional[int] = ..., starty: Optional[int] = ...) -> None: ... +def title(titlestring: str) -> None: ... +def bye() -> None: ... +def exitonclick() -> None: ... +def Screen() -> _Screen: ... + # Functions copied from TNavigator: def degrees(fullcircle: float = ...) -> None: ...