Using property() to extend Tkinter classes but Tkinter classes are old-style classes?

python at bdurham.com python at bdurham.com
Mon Nov 29 09:09:07 EST 2010


Michele and Terry,

> From: "Michele Simionato" <michele.simionato at gmail.com>
>
> Notice that you can upgrade a Tkinter class to a new-style class simply by deriving from object. For instance you could define a new-style Label class as:
>
> class Label(Tkinter.Label, object):
>   pass

Michele - your technique is *exactly* what I was searching for (and
works well so far!). Terry - your explanation why Tkinter still uses old
style classes (for compatibility with existing code) makes sense.

Thank you both.

Malcolm



More information about the Python-list mailing list