Multiple ExtensionClass

Emile van Sebille emile at fenx.com
Fri Feb 18 01:41:01 CET 2000


This works for me:

>>> class A:
 def func1(self):
  print "in func1"


>>> class B(A):
 def func2(self):
  print "in func2"


>>> a = B()
>>> a.func1()
in func1
>>>

Emile van Sebille
emile at fenx.com
-------------------


----- Original Message -----
From: Joel Lucsy <jjlucsy at concentric.net>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Thursday, February 17, 2000 11:03 AM
Subject: Multiple ExtensionClass


> 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)
>
>
>
>
>
> --
> http://www.python.org/mailman/listinfo/python-list
>
>






More information about the Python-list mailing list