My experience writing my own code, and rewriting other people's, is that with tracing turned off, tracer(0)
, the Turtle.speed()
method makes no difference. The turtle.py source code appears to echo this:
if self._speed and screen._tracing == 1:
Only if we're tracing, tracer(1)
, do we even consider the turtle's speed.
Furthermore, my experience has been that turning off tracing has more effect than turtle.speed('fastest')
as the speed()
method only affects individual turtles whereas tracer(0)
affects all the turtles and potentially other actions.
My own rules of thumb with respect to tracer()
:
Use update()
to show the user the current graphic state, avoid
turning tracer()
on and off for this purpose.
Don't assume your update()
calls are the only ones. Some turtle operations
call update()
so don't be surprised.
Don't turn tracing off until your code is basically working -- i.e. don't
debug in the dark.
If you're not using events (e.g. mouse, keyboard, timer), then turn tracing back on just before the
final mainloop()
call or equivalent. Otherwise late actions like hiding
the turtle won't appear to happen.
Don't use any argument other than 0 and 1 (or False
and True
.) Setting
a numeric value to force updates every Nth action is tricky to work
out and usually wrong.
If you turn off tracing, you can toss your speed()
calls.
tracer()
has not been deprecated,Turtle.tracer()
was deprecated.Screen.tracer()
still works fine. – Cybernetics