[docs] Turtle graphics, what is the function done doing?

Csaba Szepesvari szepesva at ualberta.ca
Fri Mar 16 03:07:01 CET 2012


Hi Sandro,

I have found another minor issue.
In Section 23.1.4.3, Using Screen Events,
it is (implicitly) suggested that the functions
turtle.onclick(fun, btn=1, add=None)
turtle.onscreenclick(fun, btn=1, add=None)
will behave identically.
However, what happens is that turtle.onclick will call onclick on the 
default turtle and is not identical to an Screen().onclick()
(the example assumes you used import turtle at the beginning).
I would suggest this to be clarified in the documentation (looking at 
the source, this is because turtle.onclick is bound twice when the 
module is imported; first to the default screen's method, and then to 
the default turtle's corresponding method).
Cheers,
   Csaba

On 11-10-31 3:17 AM, Sandro Tosi wrote:
> Hello Csaba,
>
> On Tue, Oct 18, 2011 at 16:54, Csaba Szepesvari<szepesva at ualberta.ca>  wrote:
>> Hi,
>>
>> Look at the example code at:
>> http://docs.python.org/py3k/library/turtle.html#turtle.towards
>>
>> from turtle import *
>> color('red', 'yellow')
>> begin_fill()
>> while True:
>>      forward(200)
>>      left(170)
>>      if abs(pos())<  1:
>>          break
>> end_fill()
>> done()
>>
>> It calls the done() function at the end. However, this function is not
>> documented.
>> My experimentation shows that this is really coming from the turtle module,
>> so it should be documented here.. (or at least pls give some pointer to its
>> documentation).
>
> This has now been fixed with these commits:
>
>      http://hg.python.org/cpython/rev/1588b678d634
>      http://hg.python.org/cpython/rev/e23baae539f7
>      http://hg.python.org/cpython/rev/c7963dff98fa
>
> Regards,


More information about the docs mailing list