Uh, oh.
I think I found the bug, and it was a *really stupid bug*.
The list of GUI_PLUGINS was empty... so there was no plugin class that
was inherited.
I'm embarrassed to have wasted your time that way. However I learned a
lot about new-style classes and so on, so for me it was a learning
experi
On 28 Giu, 15:37, Peter Otten <[EMAIL PROTECTED]> wrote:
> Post a self-contained example.
Now I'm even more confused. The self-contained example is below... and
it works, using only old-style declarations.
#!/usr/bin/env python
import wx
import cmd
global CLI_PLUGINS
global GUI_PLUGINS
class
massimo s. a écrit :
> On 28 Giu, 14:41, "massimo s." <[EMAIL PROTECTED]> wrote:
>
>> The new-style behaviour only appears when wxFrame is plugged with the
>> current hack.
>> That is:
>>
>> - print type(self) in wxFrame alone returns
>> - print type(self) in the plugged (multiply inherited) wxFr
massimo s. a écrit :
> On 28 Giu, 13:45, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>>
>> wrt/ this snippet:
>>
>> for plugin_name in self.config['plugins']:
>> try:
>> plugin=__import__(plugin_name)
>> try:
>> print type(self)
>>
On 28 Giu, 15:37, Peter Otten <[EMAIL PROTECTED]> wrote:
> massimo s. wrote:
> > Again: using a new-style plugin class for multiple inheritance does
> > not work.
>
> This statement is certainly too broad.
>
> [earlier]
>
> > TypeError: unbound method _plug_init() must be called with
> > dummyguipl
massimo s. wrote:
> Again: using a new-style plugin class for multiple inheritance does
> not work.
This statement is certainly too broad.
[earlier]
> TypeError: unbound method _plug_init() must be called with
> dummyguiplugGui instance as first argument (got MainWindowPlugged
> instance instead
On 28 Giu, 14:41, "massimo s." <[EMAIL PROTECTED]> wrote:
> The new-style behaviour only appears when wxFrame is plugged with the
> current hack.
> That is:
>
> - print type(self) in wxFrame alone returns
> - print type(self) in the plugged (multiply inherited) wxFrame returns
> < class '__main__
massimo s. wrote:
> On 28 Giu, 13:45, Bruno Desthuilliers [EMAIL PROTECTED]> wrote:
>> massimo s. a écrit :
>>
At this point, it seems too much a deep object-oriented hell to be
able to dig it myself. Would you help me getting some cue on the
problem?
>>> Update. Now I know that:
>>
On 28 Giu, 13:45, Bruno Desthuilliers 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()
so in fact what I see has something to do with new style cla
On 28 Giu, 13:45, Bruno Desthuilliers wrote:
>
> wrt/ this snippet:
>
> for plugin_name in self.config['plugins']:
> try:
> plugin=__import__(plugin_name)
> try:
> print type(self)
> eval('plugin.'+plugin_name+'Commands._plu
On 28 Giu, 13:45, Bruno Desthuilliers wrote:
> massimo s. a écrit :
>
> >> At this point, it seems too much a deep object-oriented hell to be
> >> able to dig it myself. Would you help me getting some cue on the
> >> problem?
>
> > Update. Now I know that:
> > - every sane Python class should retu
massimo s. a écrit :
>> At this point, it seems too much a deep object-oriented hell to be
>> able to dig it myself. Would you help me getting some cue on the
>> problem?
>
> Update. Now I know that:
> - every sane Python class should return after
> type(self)
Certainly not, unless you're using
"massimo s." <[EMAIL PROTECTED]> wrote:
> Now I know that:
> - every sane Python class should return after
> type(self)
Wrong. Only old style classes are 'instance' type, and you should never be
using an old style class unless you have a very good reason for it. Always
use 'object' (or another
> At this point, it seems too much a deep object-oriented hell to be
> able to dig it myself. Would you help me getting some cue on the
> problem?
Update. Now I know that:
- every sane Python class should return after
type(self)
- when disabling the multiple-inheritance-hack, the situation comes
14 matches
Mail list logo