This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Multiple turtle tracers
Type: behavior Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: amcnerney13, gregorlingl, terry.reedy
Priority: normal Keywords:

Created on 2011-02-02 05:02 by amcnerney13, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg127718 - (view) Author: Alex McNerney (amcnerney13) Date: 2011-02-02 05:02
In Python 2.7 and 2.6 (only ones I have tried), there is a bug in the turtle module's tracer() function, when applying it to multiple turtles using the same value.

When two turtles are defined (to draw simultaneously), and both turtles' tracers are set to the same number, one of the turtles does not end up following its tracer value. (It's a little hard to explain...look at/try the sample code)

The following script will recreate this glitch:
"
from turtle import *

t1 = Turtle()
t2 = Turtle()

for t in turtles():
    t.ht()
    t.speed(0)
    t.tracer(10)

t1.color("black")
t2.color("red")

for x in range(500):
    t1.forward(x)
    t2.forward(x)
    t1.left(144.5)
    t2.right(144.5)
"
msg127719 - (view) Author: Alex McNerney (amcnerney13) Date: 2011-02-02 08:12
To be more clear, in the sample code, the drawing animation of the red star-spiral is smooth, whereas the drawing animation of the black star-spiral is spasmodic.
msg127966 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-02-05 01:34
2.6 is only open for security fixes.

In 3.x "The methods Turtle.tracer(), Turtle.window_width() and Turtle.window_height() have been eliminated. Methods with these names and functionality are now available only as methods of Screen."

So it seems that perhaps the fix was to make what you did impossible ;-). Hence, I am inclined to close this as 'out-of-date'. The deletion was not done in 2.7 for back-compatibility reasons.

Replacing "    t.tracer(10)" with "\nScreen().tracer(10)", the rosette is drawn in under a second (on my several-year-old machine). I cannot see any difference.
History
Date User Action Args
2022-04-11 14:57:12adminsetgithub: 55305
2013-11-05 03:57:33terry.reedysetstatus: open -> closed
resolution: out of date
stage: resolved
2011-02-05 01:34:11terry.reedysetnosy: + terry.reedy, gregorlingl

messages: + msg127966
versions: - Python 2.6
2011-02-02 08:12:02amcnerney13setmessages: + msg127719
2011-02-02 05:02:44amcnerney13create