-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
turtle.pyi
700 lines (655 loc) · 21.6 KB
/
turtle.pyi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
from collections.abc import Callable, Sequence
from tkinter import Canvas, Frame, Misc, PhotoImage, Scrollbar
from typing import Any, ClassVar, overload
from typing_extensions import Self, TypeAlias
__all__ = [
"ScrolledCanvas",
"TurtleScreen",
"Screen",
"RawTurtle",
"Turtle",
"RawPen",
"Pen",
"Shape",
"Vec2D",
"addshape",
"bgcolor",
"bgpic",
"bye",
"clearscreen",
"colormode",
"delay",
"exitonclick",
"getcanvas",
"getshapes",
"listen",
"mainloop",
"mode",
"numinput",
"onkey",
"onkeypress",
"onkeyrelease",
"onscreenclick",
"ontimer",
"register_shape",
"resetscreen",
"screensize",
"setup",
"setworldcoordinates",
"textinput",
"title",
"tracer",
"turtles",
"update",
"window_height",
"window_width",
"back",
"backward",
"begin_fill",
"begin_poly",
"bk",
"circle",
"clear",
"clearstamp",
"clearstamps",
"clone",
"color",
"degrees",
"distance",
"dot",
"down",
"end_fill",
"end_poly",
"fd",
"fillcolor",
"filling",
"forward",
"get_poly",
"getpen",
"getscreen",
"get_shapepoly",
"getturtle",
"goto",
"heading",
"hideturtle",
"home",
"ht",
"isdown",
"isvisible",
"left",
"lt",
"onclick",
"ondrag",
"onrelease",
"pd",
"pen",
"pencolor",
"pendown",
"pensize",
"penup",
"pos",
"position",
"pu",
"radians",
"right",
"reset",
"resizemode",
"rt",
"seth",
"setheading",
"setpos",
"setposition",
"settiltangle",
"setundobuffer",
"setx",
"sety",
"shape",
"shapesize",
"shapetransform",
"shearfactor",
"showturtle",
"speed",
"st",
"stamp",
"tilt",
"tiltangle",
"towards",
"turtlesize",
"undo",
"undobufferentries",
"up",
"width",
"write",
"xcor",
"ycor",
"write_docstringdict",
"done",
"Terminator",
]
# 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
# same, but as per the "no union returns" typeshed policy, we'll return
# Any instead.
_Color: TypeAlias = str | tuple[float, float, float]
_AnyColor: TypeAlias = Any
# TODO: Replace this with a TypedDict once it becomes standardized.
_PenState: TypeAlias = dict[str, Any]
_Speed: TypeAlias = str | float
_PolygonCoords: TypeAlias = Sequence[tuple[float, float]]
class Vec2D(tuple[float, float]):
def __new__(cls, x: float, y: float) -> Self: ...
def __add__(self, other: tuple[float, float]) -> Vec2D: ... # type: ignore[override]
@overload # type: ignore[override]
def __mul__(self, other: Vec2D) -> float: ...
@overload
def __mul__(self, other: float) -> Vec2D: ...
def __rmul__(self, other: float) -> Vec2D: ... # type: ignore[override]
def __sub__(self, other: tuple[float, float]) -> Vec2D: ...
def __neg__(self) -> Vec2D: ...
def __abs__(self) -> float: ...
def rotate(self, angle: float) -> Vec2D: ...
# Does not actually inherit from Canvas, but dynamically gets all methods of Canvas
class ScrolledCanvas(Canvas, Frame): # type: ignore[misc]
bg: str
hscroll: Scrollbar
vscroll: Scrollbar
def __init__(
self, master: Misc | None, width: int = 500, height: int = 350, canvwidth: int = 600, canvheight: int = 500
) -> None: ...
canvwidth: int
canvheight: int
def reset(self, canvwidth: int | None = None, canvheight: int | None = None, bg: str | None = None) -> None: ...
class TurtleScreenBase:
cv: Canvas
canvwidth: int
canvheight: int
xscale: float
yscale: float
def __init__(self, cv: Canvas) -> None: ...
def mainloop(self) -> None: ...
def textinput(self, title: str, prompt: str) -> str | None: ...
def numinput(
self, title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None
) -> float | None: ...
class Terminator(Exception): ...
class TurtleGraphicsError(Exception): ...
class Shape:
def __init__(self, type_: str, 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 clear(self) -> None: ...
@overload
def mode(self, mode: None = None) -> str: ...
@overload
def mode(self, mode: str) -> 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
def colormode(self, cmode: None = None) -> float: ...
@overload
def colormode(self, cmode: float) -> None: ...
def reset(self) -> None: ...
def turtles(self) -> list[Turtle]: ...
@overload
def bgcolor(self) -> _AnyColor: ...
@overload
def bgcolor(self, color: _Color) -> None: ...
@overload
def bgcolor(self, r: float, g: float, b: float) -> None: ...
@overload
def tracer(self, n: None = None) -> int: ...
@overload
def tracer(self, n: int, delay: int | None = None) -> None: ...
@overload
def delay(self, delay: None = None) -> int: ...
@overload
def delay(self, delay: int) -> None: ...
def update(self) -> None: ...
def window_width(self) -> int: ...
def window_height(self) -> int: ...
def getcanvas(self) -> Canvas: ...
def getshapes(self) -> list[str]: ...
def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ...
def onkey(self, fun: Callable[[], object], key: str) -> None: ...
def listen(self, xdummy: float | None = None, ydummy: float | None = None) -> None: ...
def ontimer(self, fun: Callable[[], object], t: int = 0) -> None: ...
@overload
def bgpic(self, picname: None = None) -> str: ...
@overload
def bgpic(self, picname: str) -> None: ...
@overload
def screensize(self, canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ...
# Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well
@overload
def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ...
onscreenclick = onclick
resetscreen = reset
clearscreen = clear
addshape = register_shape
def onkeypress(self, fun: Callable[[], object], key: str | None = None) -> None: ...
onkeyrelease = onkey
class TNavigator:
START_ORIENTATION: dict[str, Vec2D]
DEFAULT_MODE: str
DEFAULT_ANGLEOFFSET: int
DEFAULT_ANGLEORIENT: int
def __init__(self, mode: str = "standard") -> None: ...
def reset(self) -> None: ...
def degrees(self, fullcircle: float = 360.0) -> None: ...
def radians(self) -> None: ...
def forward(self, distance: float) -> None: ...
def back(self, distance: float) -> None: ...
def right(self, angle: float) -> None: ...
def left(self, angle: float) -> None: ...
def pos(self) -> Vec2D: ...
def xcor(self) -> float: ...
def ycor(self) -> float: ...
@overload
def goto(self, x: tuple[float, float], y: None = None) -> None: ...
@overload
def goto(self, x: float, y: float) -> None: ...
def home(self) -> None: ...
def setx(self, x: float) -> None: ...
def sety(self, y: float) -> None: ...
@overload
def distance(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ...
@overload
def distance(self, x: float, y: float) -> float: ...
@overload
def towards(self, x: TNavigator | tuple[float, float], y: None = None) -> float: ...
@overload
def towards(self, x: float, y: float) -> float: ...
def heading(self) -> float: ...
def setheading(self, to_angle: float) -> None: ...
def circle(self, radius: float, extent: float | None = None, steps: int | None = None) -> None: ...
fd = forward
bk = back
backward = back
rt = right
lt = left
position = pos
setpos = goto
setposition = goto
seth = setheading
class TPen:
def __init__(self, resizemode: str = "noresize") -> None: ...
@overload
def resizemode(self, rmode: None = None) -> str: ...
@overload
def resizemode(self, rmode: str) -> None: ...
@overload
def pensize(self, width: None = None) -> int: ...
@overload
def pensize(self, width: int) -> None: ...
def penup(self) -> None: ...
def pendown(self) -> None: ...
def isdown(self) -> bool: ...
@overload
def speed(self, speed: None = None) -> int: ...
@overload
def speed(self, speed: _Speed) -> None: ...
@overload
def pencolor(self) -> _AnyColor: ...
@overload
def pencolor(self, color: _Color) -> None: ...
@overload
def pencolor(self, r: float, g: float, b: float) -> None: ...
@overload
def fillcolor(self) -> _AnyColor: ...
@overload
def fillcolor(self, color: _Color) -> None: ...
@overload
def fillcolor(self, r: float, g: float, b: float) -> None: ...
@overload
def color(self) -> tuple[_AnyColor, _AnyColor]: ...
@overload
def color(self, color: _Color) -> None: ...
@overload
def color(self, r: float, g: float, b: float) -> None: ...
@overload
def color(self, color1: _Color, color2: _Color) -> None: ...
def showturtle(self) -> None: ...
def hideturtle(self) -> None: ...
def isvisible(self) -> bool: ...
# Note: signatures 1 and 2 overlap unsafely when no arguments are provided
@overload
def pen(self) -> _PenState: ... # type: ignore[misc]
@overload
def pen(
self,
pen: _PenState | None = None,
*,
shown: bool = ...,
pendown: bool = ...,
pencolor: _Color = ...,
fillcolor: _Color = ...,
pensize: int = ...,
speed: int = ...,
resizemode: str = ...,
stretchfactor: tuple[float, float] = ...,
outline: int = ...,
tilt: float = ...,
) -> None: ...
width = pensize
up = penup
pu = penup
pd = pendown
down = pendown
st = showturtle
ht = hideturtle
class RawTurtle(TPen, TNavigator):
screen: TurtleScreen
screens: ClassVar[list[TurtleScreen]]
def __init__(
self,
canvas: Canvas | TurtleScreen | None = None,
shape: str = "classic",
undobuffersize: int = 1000,
visible: bool = True,
) -> None: ...
def reset(self) -> None: ...
def setundobuffer(self, size: int | None) -> None: ...
def undobufferentries(self) -> int: ...
def clear(self) -> None: ...
def clone(self) -> Self: ...
@overload
def shape(self, name: None = None) -> str: ...
@overload
def shape(self, name: str) -> None: ...
# Unsafely overlaps when no arguments are provided
@overload
def shapesize(self) -> tuple[float, float, float]: ... # type: ignore[misc]
@overload
def shapesize(
self, stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None
) -> None: ...
@overload
def shearfactor(self, shear: None = None) -> float: ...
@overload
def shearfactor(self, shear: float) -> None: ...
# Unsafely overlaps when no arguments are provided
@overload
def shapetransform(self) -> tuple[float, float, float, float]: ... # type: ignore[misc]
@overload
def shapetransform(
self, t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None
) -> None: ...
def get_shapepoly(self) -> _PolygonCoords | None: ...
def settiltangle(self, angle: float) -> None: ...
@overload
def tiltangle(self, angle: None = None) -> float: ...
@overload
def tiltangle(self, angle: float) -> None: ...
def tilt(self, angle: float) -> None: ...
# Can return either 'int' or Tuple[int, ...] based on if the stamp is
# a compound stamp or not. So, as per the "no Union return" policy,
# we return Any.
def stamp(self) -> Any: ...
def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ...
def clearstamps(self, n: int | None = None) -> None: ...
def filling(self) -> bool: ...
def begin_fill(self) -> None: ...
def end_fill(self) -> None: ...
def dot(self, size: int | None = None, *color: _Color) -> None: ...
def write(
self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")
) -> None: ...
def begin_poly(self) -> None: ...
def end_poly(self) -> None: ...
def get_poly(self) -> _PolygonCoords | None: ...
def getscreen(self) -> TurtleScreen: ...
def getturtle(self) -> Self: ...
getpen = getturtle
def onclick(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ...
def onrelease(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ...
def ondrag(self, fun: Callable[[float, float], object], btn: int = 1, add: bool | None = None) -> None: ...
def undo(self) -> None: ...
turtlesize = shapesize
class _Screen(TurtleScreen):
def __init__(self) -> None: ...
# Note int and float are interpreted differently, hence the Union instead of just float
def setup(
self,
width: int | float = 0.5, # noqa: Y041
height: int | float = 0.75, # noqa: Y041
startx: int | None = None,
starty: int | None = None,
) -> None: ...
def title(self, titlestring: str) -> None: ...
def bye(self) -> None: ...
def exitonclick(self) -> None: ...
class Turtle(RawTurtle):
def __init__(self, shape: str = "classic", undobuffersize: int = 1000, visible: bool = True) -> None: ...
RawPen = RawTurtle
Pen = Turtle
def write_docstringdict(filename: str = "turtle_docstringdict") -> None: ...
# Note: it's somewhat unfortunate that we have to copy the function signatures.
# It would be nice if we could partially reduce the redundancy by doing something
# like the following:
#
# _screen: Screen
# clear = _screen.clear
#
# However, it seems pytype does not support this type of syntax in pyi files.
# Functions copied from TurtleScreenBase:
# Note: mainloop() was always present in the global scope, but was added to
# TurtleScreenBase in Python 3.0
def mainloop() -> None: ...
def textinput(title: str, prompt: str) -> str | None: ...
def numinput(
title: str, prompt: str, default: float | None = None, minval: float | None = None, maxval: float | None = None
) -> float | None: ...
# Functions copied from TurtleScreen:
def clear() -> None: ...
@overload
def mode(mode: None = None) -> str: ...
@overload
def mode(mode: str) -> None: ...
def setworldcoordinates(llx: float, lly: float, urx: float, ury: float) -> None: ...
def register_shape(name: str, shape: _PolygonCoords | Shape | None = None) -> None: ...
@overload
def colormode(cmode: None = None) -> float: ...
@overload
def colormode(cmode: float) -> None: ...
def reset() -> None: ...
def turtles() -> list[Turtle]: ...
@overload
def bgcolor() -> _AnyColor: ...
@overload
def bgcolor(color: _Color) -> None: ...
@overload
def bgcolor(r: float, g: float, b: float) -> None: ...
@overload
def tracer(n: None = None) -> int: ...
@overload
def tracer(n: int, delay: int | None = None) -> None: ...
@overload
def delay(delay: None = None) -> int: ...
@overload
def delay(delay: int) -> None: ...
def update() -> None: ...
def window_width() -> int: ...
def window_height() -> int: ...
def getcanvas() -> Canvas: ...
def getshapes() -> list[str]: ...
def onclick(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ...
def onkey(fun: Callable[[], object], key: str) -> None: ...
def listen(xdummy: float | None = None, ydummy: float | None = None) -> None: ...
def ontimer(fun: Callable[[], object], t: int = 0) -> None: ...
@overload
def bgpic(picname: None = None) -> str: ...
@overload
def bgpic(picname: str) -> None: ...
@overload
def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None) -> tuple[int, int]: ...
@overload
def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ...
onscreenclick = onclick
resetscreen = reset
clearscreen = clear
addshape = register_shape
def onkeypress(fun: Callable[[], object], key: str | None = None) -> None: ...
onkeyrelease = onkey
# Functions copied from _Screen:
def setup(width: float = 0.5, height: float = 0.75, startx: int | None = None, starty: int | None = None) -> None: ...
def title(titlestring: str) -> None: ...
def bye() -> None: ...
def exitonclick() -> None: ...
def Screen() -> _Screen: ...
# Functions copied from TNavigator:
def degrees(fullcircle: float = 360.0) -> None: ...
def radians() -> None: ...
def forward(distance: float) -> None: ...
def back(distance: float) -> None: ...
def right(angle: float) -> None: ...
def left(angle: float) -> None: ...
def pos() -> Vec2D: ...
def xcor() -> float: ...
def ycor() -> float: ...
@overload
def goto(x: tuple[float, float], y: None = None) -> None: ...
@overload
def goto(x: float, y: float) -> None: ...
def home() -> None: ...
def setx(x: float) -> None: ...
def sety(y: float) -> None: ...
@overload
def distance(x: TNavigator | tuple[float, float], y: None = None) -> float: ...
@overload
def distance(x: float, y: float) -> float: ...
@overload
def towards(x: TNavigator | tuple[float, float], y: None = None) -> float: ...
@overload
def towards(x: float, y: float) -> float: ...
def heading() -> float: ...
def setheading(to_angle: float) -> None: ...
def circle(radius: float, extent: float | None = None, steps: int | None = None) -> None: ...
fd = forward
bk = back
backward = back
rt = right
lt = left
position = pos
setpos = goto
setposition = goto
seth = setheading
# Functions copied from TPen:
@overload
def resizemode(rmode: None = None) -> str: ...
@overload
def resizemode(rmode: str) -> None: ...
@overload
def pensize(width: None = None) -> int: ...
@overload
def pensize(width: int) -> None: ...
def penup() -> None: ...
def pendown() -> None: ...
def isdown() -> bool: ...
@overload
def speed(speed: None = None) -> int: ...
@overload
def speed(speed: _Speed) -> None: ...
@overload
def pencolor() -> _AnyColor: ...
@overload
def pencolor(color: _Color) -> None: ...
@overload
def pencolor(r: float, g: float, b: float) -> None: ...
@overload
def fillcolor() -> _AnyColor: ...
@overload
def fillcolor(color: _Color) -> None: ...
@overload
def fillcolor(r: float, g: float, b: float) -> None: ...
@overload
def color() -> tuple[_AnyColor, _AnyColor]: ...
@overload
def color(color: _Color) -> None: ...
@overload
def color(r: float, g: float, b: float) -> None: ...
@overload
def color(color1: _Color, color2: _Color) -> None: ...
def showturtle() -> None: ...
def hideturtle() -> None: ...
def isvisible() -> bool: ...
# Note: signatures 1 and 2 overlap unsafely when no arguments are provided
@overload
def pen() -> _PenState: ... # type: ignore[misc]
@overload
def pen(
pen: _PenState | None = None,
*,
shown: bool = ...,
pendown: bool = ...,
pencolor: _Color = ...,
fillcolor: _Color = ...,
pensize: int = ...,
speed: int = ...,
resizemode: str = ...,
stretchfactor: tuple[float, float] = ...,
outline: int = ...,
tilt: float = ...,
) -> None: ...
width = pensize
up = penup
pu = penup
pd = pendown
down = pendown
st = showturtle
ht = hideturtle
# Functions copied from RawTurtle:
def setundobuffer(size: int | None) -> None: ...
def undobufferentries() -> int: ...
@overload
def shape(name: None = None) -> str: ...
@overload
def shape(name: str) -> None: ...
# Unsafely overlaps when no arguments are provided
@overload
def shapesize() -> tuple[float, float, float]: ... # type: ignore[misc]
@overload
def shapesize(stretch_wid: float | None = None, stretch_len: float | None = None, outline: float | None = None) -> None: ...
@overload
def shearfactor(shear: None = None) -> float: ...
@overload
def shearfactor(shear: float) -> None: ...
# Unsafely overlaps when no arguments are provided
@overload
def shapetransform() -> tuple[float, float, float, float]: ... # type: ignore[misc]
@overload
def shapetransform(
t11: float | None = None, t12: float | None = None, t21: float | None = None, t22: float | None = None
) -> None: ...
def get_shapepoly() -> _PolygonCoords | None: ...
def settiltangle(angle: float) -> None: ...
@overload
def tiltangle(angle: None = None) -> float: ...
@overload
def tiltangle(angle: float) -> None: ...
def tilt(angle: float) -> None: ...
# Can return either 'int' or Tuple[int, ...] based on if the stamp is
# a compound stamp or not. So, as per the "no Union return" policy,
# we return Any.
def stamp() -> Any: ...
def clearstamp(stampid: int | tuple[int, ...]) -> None: ...
def clearstamps(n: int | None = None) -> None: ...
def filling() -> bool: ...
def begin_fill() -> None: ...
def end_fill() -> None: ...
def dot(size: int | None = None, *color: _Color) -> None: ...
def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")) -> None: ...
def begin_poly() -> None: ...
def end_poly() -> None: ...
def get_poly() -> _PolygonCoords | None: ...
def getscreen() -> TurtleScreen: ...
def getturtle() -> Turtle: ...
getpen = getturtle
def onrelease(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ...
def ondrag(fun: Callable[[float, float], object], btn: int = 1, add: Any | None = None) -> None: ...
def undo() -> None: ...
turtlesize = shapesize
# Functions copied from RawTurtle with a few tweaks:
def clone() -> Turtle: ...
# Extra functions present only in the global scope:
done = mainloop