Using property in classic class may not work

A. Lloyd Flanagan alloydflanagan at attbi.com
Tue Apr 15 09:27:16 EDT 2003


Alex Martelli <aleax at aleax.it> wrote in message news:<ifPma.15344$LB6.409776 at news1.tin.it>...
> Neil Hodgson wrote:
> 
> >     The class in question is derived from a wxWindows class, so I can't
> > make it derive just from object. The "What's New in Python 2.2" document
> > only mentions property wrt new-style clases. Can I depend on property
> > working for classic classes? Is there a workaround such as deriving from
> > object as well?
> 
> No, and yes, respectively -- deriving from object means your class
> isn't classic any more, so properties do work as intended there.  Vide:
> 
... (big chunck cut) ...
> as you see, this does work as intended.
> 
> 
> Alex

However, the last time I tried to subclass from both wxFrame and
object, wxPython freaked out (that's a technical term for "I don't
remember what happened, but boy, it sure didn't work").
Not sure about the latest version of wxPython, though -- there's
binaries for python 2.3 out by now.  I'll have to try it again..




More information about the Python-list mailing list