Repository navigation
Turtle dot function not accepting color parameter. #138772
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
on Sep 11, 2025 Error definitely happens, i can reproduce this on WSL and Windows all the way back to 3.9 (havent tested further)
n$ python my_test.py Traceback (most recent call last): File "/mnt/d/Programming/Projects/cpython/my_test.py", line 11, in <module> Turtle.dot(color=random.choice(color_list), size=25) ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: RawTurtle.dot() got an unexpected keyword argument 'color'But isnt that just how the signature
turtle.dot(size=None, *color)is supposed to work? There is no single argument "color" that you could address via keyword. We have "*args" which are just named "*color" here.Reacted by Serhiy Storchaka and Sebastian Rittau- addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
on Sep 11, 2025 Maybe the docs should be clearer on the expected syntax?
There also seem to be exactly no tests for
Turtle.dot()unless i am missing something: https://github.com/python/cpython/blob/main/Lib/test/test_turtle.py#L568and a search over the whole repo for ".dot(" only brings up the docstring (and docs).
$ grep -R -n '\.dot(' . ./Doc/library/turtle.rst:793: >>> turtle.dot() ./Doc/library/turtle.rst:794: >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) ./Lib/turtle.py:3474: >>> turtle.dot() ./Lib/turtle.py:3475: >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) Binary file ./Lib/__pycache__/turtle.cpython-315.pyc matchesIn my opinion, the documentation is not the issue. When I attempt to provide a color parameter as specified in the documentation https://docs.python.org/3/library/turtle.html#turtle.dot I encounter an error. Similarly, if I omit the color parameter, I also encounter an error.
@PortalWalkerCodes that link you provided goes to nowhere.
Also you are doing
Turtle.dotinstead ofTurtle().dotanddotis not a class method.Also alternatively it is a top level function
import turtle from turtle import Turtle my_turtle = Turtle my_turtle.dot(...) turtle.dot(...)Work, but
Turtle.dot()does not.
- added a commit that references this issue
on Oct 13, 2025
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Bug report
Bug description:
Turtle dot function not accepting color parameter.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs