[Stackless] how to export user-defined python class to c++?
Christian Tismer
tismer at stackless.com
Thu Oct 7 17:14:09 CEST 2004
zouguangxian wrote:
> hi ,all :
> i want to let tasklet carry some information ,so i
> hope to derive a new class game_tasklet from tasklet.
> but how i can pass game_tasklet to PyTasklet_new ?
> the boost::python did't support stackless , there
> need some work to do . anyone can give me some advice ?
This is possible but not completely trivial, because tasklets
are dynamic classes, already. I would not derive the
class in C right now, but do it in A Python script.
From there you can import it into C and use the new
properties.
I'd propose to define new slots with the __slots__ class
entry and use these from C via the attribute interface.
ciao -chris
--
Christian Tismer :^) <mailto:tismer at stackless.com>
tismerysoft GmbH : Have a break! Take a ride on Python's
Carmerstr. 2 : *Starship* http://starship.python.net/
10623 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 31 86 04 18 home +49 30 802 86 56 mobile +49 173 24 18 776
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/
_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless
More information about the Stackless
mailing list