problem with hack using multiple inheritance for plugins
massimo s.
devicerandom at gmail.com
Thu Jun 28 08:41:18 EDT 2007
On 28 Giu, 13:45, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> wxFrame is obviously a new-style class.
I don't know if it's true, however. I tried that:
>>> class A(object):
... def __init__(self):
... print type(self)
...
>>> a=A()
<class '__main__.A'>
so in fact what I see has something to do with new style classes (if
subclassing 'object' is enough).
The new-style behaviour only appears when wxFrame is plugged with the
current hack.
That is:
- print type(self) in wxFrame alone returns <type 'instance'>
- print type(self) in the plugged (multiply inherited) wxFrame returns
< class '__main__.MainWindowPlugged'>
So the problem is that I acquire a new style behaviour somewhere!
I tried to let the plugin class be a new style class (subclassing
'object': again, I can't find a simple reference about it, I tried to
read www.python.org/doc/newstyle.html links but they are far too much
theoretical for my knowledge) and nothing seems to change at all.
m.
More information about the Python-list
mailing list