Skip to content

Commit ad38f75

Browse files
authored
Bump turtle to 3.14 (#14167)
1 parent c7e29ec commit ad38f75

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

stdlib/@tests/stubtest_allowlists/py314.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ multiprocessing.process.BaseProcess.interrupt
2828
multiprocessing.synchronize.SemLock.locked
2929
tarfile.TarFile.zstopen
3030
tkinter.Event.__class_getitem__
31-
turtle.__all__
32-
turtle.RawTurtle.fill
33-
turtle.RawTurtle.poly
34-
turtle.TurtleScreen.no_animation
35-
turtle.TurtleScreen.save
36-
turtle.fill
37-
turtle.no_animation
38-
turtle.poly
39-
turtle.save
4031

4132
# =========================
4233
# New errors in Python 3.14

stdlib/turtle.pyi

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import sys
2-
from collections.abc import Callable, Sequence
2+
from _typeshed import StrPath
3+
from collections.abc import Callable, Generator, Sequence
4+
from contextlib import contextmanager
35
from tkinter import Canvas, Frame, Misc, PhotoImage, Scrollbar
46
from typing import Any, ClassVar, Literal, TypedDict, overload
57
from typing_extensions import Self, TypeAlias
@@ -128,6 +130,9 @@ __all__ = [
128130
"Terminator",
129131
]
130132

133+
if sys.version_info >= (3, 14):
134+
__all__ += ["fill", "no_animation", "poly", "save"]
135+
131136
if sys.version_info >= (3, 12):
132137
__all__ += ["teleport"]
133138

@@ -231,6 +236,10 @@ class TurtleScreen(TurtleScreenBase):
231236
def delay(self, delay: None = None) -> int: ...
232237
@overload
233238
def delay(self, delay: int) -> None: ...
239+
if sys.version_info >= (3, 14):
240+
@contextmanager
241+
def no_animation(self) -> Generator[None]: ...
242+
234243
def update(self) -> None: ...
235244
def window_width(self) -> int: ...
236245
def window_height(self) -> int: ...
@@ -249,6 +258,8 @@ class TurtleScreen(TurtleScreenBase):
249258
# Looks like if self.cv is not a ScrolledCanvas, this could return a tuple as well
250259
@overload
251260
def screensize(self, canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ...
261+
if sys.version_info >= (3, 14):
262+
def save(self, filename: StrPath, *, overwrite: bool = False) -> None: ...
252263
onscreenclick = onclick
253264
resetscreen = reset
254265
clearscreen = clear
@@ -428,12 +439,20 @@ class RawTurtle(TPen, TNavigator): # type: ignore[misc] # Conflicting methods
428439
def clearstamp(self, stampid: int | tuple[int, ...]) -> None: ...
429440
def clearstamps(self, n: int | None = None) -> None: ...
430441
def filling(self) -> bool: ...
442+
if sys.version_info >= (3, 14):
443+
@contextmanager
444+
def fill(self) -> Generator[None]: ...
445+
431446
def begin_fill(self) -> None: ...
432447
def end_fill(self) -> None: ...
433448
def dot(self, size: int | None = None, *color: _Color) -> None: ...
434449
def write(
435450
self, arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")
436451
) -> None: ...
452+
if sys.version_info >= (3, 14):
453+
@contextmanager
454+
def poly(self) -> Generator[None]: ...
455+
437456
def begin_poly(self) -> None: ...
438457
def end_poly(self) -> None: ...
439458
def get_poly(self) -> _PolygonCoords | None: ...
@@ -516,6 +535,11 @@ def tracer(n: int, delay: int | None = None) -> None: ...
516535
def delay(delay: None = None) -> int: ...
517536
@overload
518537
def delay(delay: int) -> None: ...
538+
539+
if sys.version_info >= (3, 14):
540+
@contextmanager
541+
def no_animation() -> Generator[None]: ...
542+
519543
def update() -> None: ...
520544
def window_width() -> int: ...
521545
def window_height() -> int: ...
@@ -534,6 +558,9 @@ def screensize(canvwidth: None = None, canvheight: None = None, bg: None = None)
534558
@overload
535559
def screensize(canvwidth: int, canvheight: int, bg: _Color | None = None) -> None: ...
536560

561+
if sys.version_info >= (3, 14):
562+
def save(filename: StrPath, *, overwrite: bool = False) -> None: ...
563+
537564
onscreenclick = onclick
538565
resetscreen = reset
539566
clearscreen = clear
@@ -705,10 +732,20 @@ def stamp() -> Any: ...
705732
def clearstamp(stampid: int | tuple[int, ...]) -> None: ...
706733
def clearstamps(n: int | None = None) -> None: ...
707734
def filling() -> bool: ...
735+
736+
if sys.version_info >= (3, 14):
737+
@contextmanager
738+
def fill() -> Generator[None]: ...
739+
708740
def begin_fill() -> None: ...
709741
def end_fill() -> None: ...
710742
def dot(size: int | None = None, *color: _Color) -> None: ...
711743
def write(arg: object, move: bool = False, align: str = "left", font: tuple[str, int, str] = ("Arial", 8, "normal")) -> None: ...
744+
745+
if sys.version_info >= (3, 14):
746+
@contextmanager
747+
def poly() -> Generator[None]: ...
748+
712749
def begin_poly() -> None: ...
713750
def end_poly() -> None: ...
714751
def get_poly() -> _PolygonCoords | None: ...

0 commit comments

Comments
 (0)