Author ocean-city
Recipients benjamin.peterson, gpolo, indiedan, loewis, ocean-city, schuppenies, skomoroh, svenil
Date 2008-09-12.17:33:29
SpamBayes Score 3.62289e-08
Marked as misclassified No
Message-id <1221240810.88.0.321661698971.issue3774@psf.upfronthosting.co.za>
In-reply-to
Content
self.deletecommand doesn't remove menu item, so we don't have to care
about index shifting like bellow. +1 for gpolo's patch.

>>> a = [0, 1, 2, 3]
>>> for i in xrange(len(a)):
...     del a[i]
...
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
IndexError: list assignment index out of range


I'm not sure (self._tclCommands is not None) check is not really needed.
I was looking for the place self._tclCommands is initialized, and found
_register() is that place, but what is 'needcleanup'? :-0
But probably, gpolo's patch is right.


P.S.
This is not related to this issue, I think
"""Delete menu items between INDEX1 and INDEX2 (not included)."""
should be changed to
"""Delete menu items between INDEX1 and INDEX2 (included)."""

Please look at http://www.tcl.tk/man/tcl8.5/TkCmd/menu.htm#M59
History
Date User Action Args
2008-09-12 17:33:30ocean-citysetrecipients: + ocean-city, loewis, svenil, benjamin.peterson, gpolo, schuppenies, skomoroh, indiedan
2008-09-12 17:33:30ocean-citysetmessageid: <1221240810.88.0.321661698971.issue3774@psf.upfronthosting.co.za>
2008-09-12 17:33:30ocean-citylinkissue3774 messages
2008-09-12 17:33:29ocean-citycreate