How do I create extensions to Python in C?

Sameh chafik pro chafik at nevrax.com
Tue Jun 6 05:09:24 EDT 2000


It is okay, but why coud we dot to translate a class write in C++. The
problem that the standard way is to use the PyTypeObject and define the
constructor as a function, but python don't recognize the translation as
class but as type object.morality if i do the translation of a class "X" it
is'nt posible in python to use it as a derivate class:
class A(X):
    def dosomething(self):
    .....
    ....

is not possible.


"Courageous" <jkraska1 at san.rr.com> a écrit dans le message news:
393C95BD.77108EE at san.rr.com...
>
> > http://starship.python.net/crew/arcege/extwriting/pyext.html
>
> _Python Essential Reference_ also has a very nice section which
> summarizes many of the available primitives. If you're going
> to be doing this yourself, I recommend you take a look at
> xxobject.c in the python source. It's an empty template for
> creating a python extension module.
>
>
>
> C/





More information about the Python-list mailing list