From 31d36e3eee77ddb3dcddbf06ca51e94eb012f572 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Tue, 11 Aug 2026 16:38:42 +0200 Subject: [PATCH 1/2] Docs: simplify `turtle` tutorial's star example code (GH-155232) (cherry picked from commit 7c072c1fcc3c04535dde873a7709781be2794583) Co-authored-by: Maciej Olko Co-authored-by: Stan Ulbrych --- Doc/library/turtle.rst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 6b76648e7e25f6c..0e163c7e6e9067d 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -78,8 +78,8 @@ In a Python shell, import all the objects of the ``turtle`` module:: from turtle import * -If you run into a ``No module named '_tkinter'`` error, you'll have to -install the :mod:`Tk interface package ` on your system. +If you run into a ``Standard library module '_tkinter' was not found`` error, +you'll have to install the :mod:`Tk interface package ` on your system. Basic drawing @@ -166,14 +166,16 @@ filling can be turned on and off:: Next we'll create a loop:: + start = pos() + while True: forward(200) left(170) - if abs(pos()) < 1: + if distance(start) < 1: break -``abs(pos()) < 1`` is a good way to know when the turtle is back at its -home position. +``distance(start) < 1`` is a good way to know when the turtle is back at its +start position. Finally, complete the filling:: From 60f88aad7a4c4303a363fd080d10f1e5cce8ec4e Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Tue, 11 Aug 2026 15:41:23 +0100 Subject: [PATCH 2/2] Error message hasn't changed on this branch --- Doc/library/turtle.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst index 0e163c7e6e9067d..c694077b22f51f5 100644 --- a/Doc/library/turtle.rst +++ b/Doc/library/turtle.rst @@ -78,8 +78,8 @@ In a Python shell, import all the objects of the ``turtle`` module:: from turtle import * -If you run into a ``Standard library module '_tkinter' was not found`` error, -you'll have to install the :mod:`Tk interface package ` on your system. +If you run into a ``No module named '_tkinter'`` error, you'll have to +install the :mod:`Tk interface package ` on your system. Basic drawing