11import time
22import threading
33import writeYourProgram as _w
4+ from typing import Literal , Sequence
5+
46# Do not import tkinter at the top-level. Someone with no installation of tkinter should
57# be able to user WYPP without drawing support.
68
@@ -14,9 +16,9 @@ class Point:
1416 x : float
1517 y : float
1618
17- ShapeKind = _w . Literal ['ellipsis' , 'rectangle' ]
19+ type ShapeKind = Literal ['ellipsis' , 'rectangle' ]
1820
19- Color = _w . Literal ['red' , 'green' , 'blue' , 'yellow' , 'black' , 'white' ]
21+ type Color = Literal ['red' , 'green' , 'blue' , 'yellow' , 'black' , 'white' ]
2022
2123@_w .record
2224class FixedShape :
@@ -58,7 +60,7 @@ def _drawCoordinateSystem(canvas, windowSize: Size):
5860 canvas .create_line (x , 0 , x , windowSize .height , dash = (4 ,2 ))
5961 canvas .create_line (0 , y , windowSize .width , y , dash = (4 ,2 ))
6062
61- def drawFixedShapes (shapes : _w . Sequence [FixedShape ],
63+ def drawFixedShapes (shapes : Sequence [FixedShape ],
6264 withCoordinateSystem = False ,
6365 stopAfter = None ) -> None :
6466 try :
0 commit comments