Multiple ExtensionClass

Joel Lucsy jjlucsy at concentric.net
Thu Feb 17 21:27:47 EST 2000


Um, I was talking about the C ExtensionClass that's found in Zope. I was
only trying to illustrate a point that I was trying to accomplish in C. I
realize it works in python. Sorry.

"Emile van Sebille" <emile at fenx.com> wrote in message
news:007001bf79a8$d53748e0$01ffffc0 at worldnet.att.net...
> 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