Tkinter wart: bug or feature?

Mike Clarkson support at internetdiscovery.com
Sun Nov 17 14:38:28 EST 2002


On Sat, 16 Nov 2002 14:57:28 GMT, "Fredrik Lundh"
<fredrik at pythonware.com> wrote:

>David Eppstein wrote:
>
>> ...or do all the ugly bookkeeping necessary to make sure that image1
>> gets deleted when and only when it is no longer needed
>
>where all the "ugly bookkeeping necessary" is one extra line:
>
>    lbl = Tkinter.Label(win.window, image=image1)
>    lbl.photo = image1

This is still a bug workaround, just like using global. You're still
expecting the end user to do ugly bookkeeping, but only for images:
I don't have to hold a reference to text1 global for it to work.   
No other commonly used entity in the Tkinter API has this
counter-intuitive behavior.  It's also very counter-intuitive to what
Tkinter is wrapping, namelyTk itself.

I've seen a number of different bug workarounds for this, but
my question remains: is this a bug or feature? It has been
Benevolently declared to be Not a Bug, but clearly others have had
trouble with this too. If it's reopened as a bug we can do something 
about it as there are obvious fixes as I pointed out, but if it's a
feature there's nothing we can do.

>    "When someone says 'I want a programming language in which I
>    need only say what I wish done,' give him a lollipop." -- Alan Perlis

      "All that is necessary for evil warts to triumph, it is that a
few good men do nothing."       --     Edmund Burke, perhaps.

Mike



More information about the Python-list mailing list