[Stackless] hi, chris, can you put _PyTasklet_Type in .h file, so that i can derive a new class from it ?

Christian Tismer tismer at stackless.com
Fri Oct 8 19:11:49 CEST 2004

zouguangxian wrote:

> hi ,chris:
>    for i don't know how to use a user-defined-in-pathon
> class in C++,so i hope i can drive a new class from
> tasklet in c++. but the_PyTasklet_Type is putted in
> .c file. :) can you move it to .h ?

This is not possible, since these types are quite
special. Not putting them into the .h file is
by intent.
The _Py_tasklet_Type is not suitable for derived classes.
The real PyTasklet_Type is a dynamic one.
I cannot recommend to derive from that, easily, unless
you have understood all the type machinery in typeobject.c,
and the way how taskletobject.c builds its type.

The recommended way is to use Python for additional slots
and methods and call them from C via attribute access.

cheers - 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

More information about the Stackless mailing list