From 86da630cfffd9e8a062a5a9785c1fc46e279c28a Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 16 Dec 2021 04:02:06 -0800 Subject: [PATCH] turtle: improve RawTurtle.screen(s) types (#6603) --- stdlib/turtle.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/turtle.pyi b/stdlib/turtle.pyi index 127e07c31..8542fc8bf 100644 --- a/stdlib/turtle.pyi +++ b/stdlib/turtle.pyi @@ -1,5 +1,5 @@ from tkinter import Canvas, Frame, PhotoImage -from typing import Any, Callable, Dict, Sequence, Tuple, TypeVar, Union, overload +from typing import Any, Callable, ClassVar, Dict, Sequence, Tuple, TypeVar, Union, overload # Note: '_Color' is the alias we use for arguments and _AnyColor is the # alias we use for return types. Really, these two aliases should be the @@ -208,7 +208,8 @@ class TPen(object): _T = TypeVar("_T") class RawTurtle(TPen, TNavigator): - screens: list[ScrolledCanvas | Canvas | TurtleScreen] + screen: TurtleScreen + screens: ClassVar[list[TurtleScreen]] def __init__( self, canvas: Canvas | TurtleScreen | None = ..., shape: str = ..., undobuffersize: int = ..., visible: bool = ... ) -> None: ...