Turtle Graphics are incompatible with gmpy

Gregor Lingl gregor.lingl at aon.at
Wed Aug 5 09:37:08 CEST 2009


Steven D'Aprano schrieb:
> On Wed, 5 Aug 2009 03:49 pm Mensanator wrote:
> 
>> In 3.1, tracing is now a screen attribute, not a turtle atribute.
>> I have no idea why
>>
>>   tooter = turtle.Turtle()
>>   tooter.tracer(False)
>>
>> doesn't give me an error (I thought silent errors were a bad thing).
> 
> What makes it an error? Do you consider the following an error?
> 
>>>> class Test:
> ...     pass
> ...
>>>> t = Test()
>>>> t.tracer = 5
>>>>
> 
> Perhaps you mean, it's an API change you didn't know about, and you wish to
> protest that Turtle Graphics made an incompatible API change without
> telling you?
> 

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.

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.

Regards,
Gregor


> 
>> Naturally, having tracing on caused my program to crash. 
> 
> It seg faulted or raised an exception?
> 
> 
> [...] 
>> Unfortunately, that calculation of nhops is illegal if diffsq is
>> an .mpf (gmpy floating point). Otherwise, you get
> 
> How does diffsq get to be a mpf? Are gmpy floats supposed to be supported?
> 
> 
> 



More information about the Python-list mailing list