Multiple ExtensionClass
Joel Lucsy
jjlucsy at concentric.net
Tue Feb 22 18:37:25 EST 2000
More information about the Python-list mailing list
Tue Feb 22 18:37:25 EST 2000
- Previous message (by thread): Multiple ExtensionClass
- Next message (by thread): dialog
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
You miss the point, I'm writing the classes in C, not Python. I'm using the ExtensionClass library from Zope. "Jerry" <2jerry at writeme.com> wrote in message news:88v35e$2d2$1 at wanadoo.fr... > 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) > >> > >> > >> > >> > >> > > > > > > > > > >
- Previous message (by thread): Multiple ExtensionClass
- Next message (by thread): dialog
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list