[Patches] [ python-Patches-1519566 ] turtle.py: correcting begin_fill

SourceForge.net noreply at sourceforge.net
Sun Jul 9 16:45:26 CEST 2006


Patches item #1519566, was opened at 2006-07-09 14:42
Message generated for change (Settings changed) made by gregorlingl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1519566&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Lingl (gregorlingl)
>Assigned to: Martin v. Löwis (loewis)
Summary: turtle.py: correcting begin_fill

Initial Comment:

In the current version of turtle.py begin_fill behaves
exactly like fill(True). That means, that a call
begin_fill() does a filling if another call
begin_fill() has been issued before. To see this, try:

>>> from turtle import *
>>> begin_fill()
>>> forward(100)
>>> left(50)
>>> forward(100)
>>> begin_fill()
>>>

Imho this is not very plausible. (Of course, calling
begin_fill twice is also not very plausible, but may be
done by beginners inadvertedly). I encountered
this problem first in a course for teachers I gave today.

I propose that begin_fill should behave differently,
namely start a new filling (as it's stated in the docs,
which are - as you see- in fact for this function
incomplete) and  discard the  butlast call  to
begin_fill.  If one really needed the current
functionality , one could resort to fill().

I discussed this with Vern Ceder at edupython list and
he replied:

Personally, my vote would be to fix it as you suggest
and submit the patch as soon as possible - it may just
be possible for it to make it into the 2.5 release.

--- 
Please note, that begin_fill was just added to 2.5, so
this slight change of functionality shouldn't create
problems.

So I submit a patch, which does this. This patch also
eliminates the attribute _tofill, which is not needed
anymore. (I think it was needed in the old circle
method). Moreover the forward(0) call at the end of the
definition of the fill method is eliminated as it does
nothing but unnecessarily duplicate a pair of
coordinates to the _path list

The patch contains also a short addition to the demo()
function, which shows that now concave forms can be filled.

Subsequently I'll add a short patch to the turtle.py
Documentation




----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1519566&group_id=5470


More information about the Patches mailing list