Multiple ExtensionClass

Jerry 2jerry at writeme.com
Tue Feb 22 17:41:50 EST 2000


Sorry to borrow you but I tried the example to see that strange behaviour:
I write this :
>>>class A:
         def fa(self):
            print "func fa"

>>>class B(A):
          def fb(self):
             print "func fb"

>>>a=B()
>>>a.fb()
func fb
>>>a.fa()
func fa

What is wrong that work properly ... do you miss the self for the class
methode ?
the trace back is significant :
raceback (innermost last):
  File "<pyshell#12>", line 1, in ?
    a.fa()
TypeError: no arguments expected

best regard, Jerry the foolish dracomorpheus, jérôme VACHER - france -

Joel Lucsy a écrit dans le message ...
>I've figured it myself (just takes time). Basically I use the
>PURE_MIXIN_CLASS macro in ExtensionClass. Since the result is an
>uninstantionable I wrapped a Python class around them. I'll be releasing
the
>end result to the public when I'm finished. I'm basically rewriting the
>pyFLTK toolkit by hand instead of using swig.
>
>"Joel Lucsy" <jjlucsy at concentric.net> wrote in message
>news:CCXq4.651$yT3.43993 at news1.usenetserver.com...
>> Ok, I've whipped up two ExtensionClass classes (stirred, not shaken) and
>am
>> trying to figure out how one can be a "subclass" of the other. I'll
>> illustrate what I want (in python for brevity):
>>
>> class A:
>>   def func1():
>>     pass
>> class B(A):
>>   def func2():
>>     pass
>>
>> Now I'd like to be able to do:
>> a=B()
>> a.func1()
>>
>> So far I haven't figured out how to do this without duplicating the
>methods.
>> Should I be messing with the method tables, or somehow manipulating the
>> dictionaries, or something completely different? I've tried making python
>> wrappers, but it complains about multiple bases or something. Basically
it
>> wont let me derive from two different ExtensionClasses's. Either that or
>I'm
>> missing something.
>> Any clues would be great. Thanks.
>>
>> --
>>  - Joel Lucsy (jjlucsy at concentric.net)
>>
>>
>>
>>
>>
>
>
>
>





More information about the Python-list mailing list