Skip to content

Docs: simplify turtle tutorial's star example code - #155232

Open
m-aciek wants to merge 3 commits into
python:mainfrom
m-aciek:turtle-simplify-star-code
Open

Docs: simplify turtle tutorial's star example code#155232
m-aciek wants to merge 3 commits into
python:mainfrom
m-aciek:turtle-simplify-star-code

Conversation

@m-aciek

@m-aciek m-aciek commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

distance(start) should be easier to understand for students than counting the length of the position vector.

The changed code is equivalent to the original, doesn't change the drawing.

cc @evildmp (author of the docs fragment)

distance(start) should be easier to understand than counting the length of a vector
@read-the-docs-community

read-the-docs-community Bot commented Aug 5, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33989757 | 📁 Comparing 471221b against main (1d90627)

  🔍 Preview build  

13 files changed · ± 13 modified

± Modified

Comment thread Doc/library/turtle.rst Outdated
Co-authored-by: Stan Ulbrych <stan@python.org>

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one little suggestion for something we can fix while we're here.

Image

Comment thread Doc/library/turtle.rst Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update this error message, on 3.15 we have:

>>> from turtle import *
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    from turtle import *
  File "/home/stan/dev/cpython/Lib/turtle.py", line 101, in <module>
    import tkinter as TK
  File "/home/stan/dev/cpython/Lib/tkinter/__init__.py", line 38, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
    ^^^^^^^^^^^^^^^
ModuleNotFoundError: Standard library module '_tkinter' was not found

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 👍 , updated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or does it require some generalisation as different environments can have the error message customised? 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or does it require some generalisation as different environments can have the error message customised?

In that case, it will hopefully be more helpful and will include instructions.

Comment thread Doc/library/turtle.rst
from turtle import *

If you run into a ``No module named '_tkinter'`` error, you'll have to
If you run into a ``Standard library module '_tkinter' was not found`` error, you'll have to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you wrap the line please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo
Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants