Turtle Graphics are incompatible with gmpy

Mensanator mensanator at aol.com
Wed Aug 5 19:33:07 CEST 2009

> It didn't form 2.5 to 2.6 (at least not intentionally). But with the
> indroduction of the TurtleScreen class and the Screen class/object
> (singleton) a few of the turtle methods were also implemented as screen
> methods and as turtle methods declared deprecated (see docs of Python
> 2.6). These deprecated turtle methods do not occur as turtle methods any
> more in Python 3.x.

More info.

Yes, there is no tracer attribute...when the object is created.

But watch this (Python 3.1):

>>> import turtle
>>> tooter = turtle.Turtle()
>>> tooter.tracer
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
AttributeError: 'Turtle' object has no attribute 'tracer'
>>> tooter.hideturtle()
>>> tooter.speed('fast')
>>> turtle.update()
>>> turtle.tracer
<function tracer at 0x013E0ED0>

Now, after setting hide, speed, update, a tracer exists.
Is that supposed to happen? That explains why there was no error
when I set the turtle attribute instead of the screen attribute.
And, of course, setting the turtle attribute accomplishes nothing,
as actual tracing is controlled by the screen attribute as you say.

> Among them is the tracer method, which in fact does not control single
> turtle objects but all the turtles on a given screen.
> So there is an icompatibility beween 2.6 and 3.x
> But as far as I have understood, this doesn't concern the problem
> reported by mensator.

Only that the problem is hidden when tracing is off, as the nhops
variable is never evaluated when trace is off.

> Regards,
> Gregor

More information about the Python-list mailing list