Eduardo Moguillansky wrote:
> I am working on python bindings for the SDIF library (sdif stands for
> sound description interchange format) via Cython.
>
> I am creating a class in cython which should wrap a C-struct called
> SdifMatrixDataT. Instances of this class can be created either
> internally in Cython or in Python. When creating them in Cython I would
> like to have either a constructor or a class method

It's good practice to use a factory instead that initialises the C
attributes of the instance manually.

http://wiki.cython.org/FAQ#head-9d29572410f6953f692486641dc555ac184cf70b

Note that the PY_NEW() macro will not call __init__(), so this is a very
good way to distinguish between a user originated class instantiation and
one from within your own internal module code.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to