[Pyrex] Use of ctypdef MyClass [object, type]

Stefan Behnel stefan_ml at behnel.de
Thu Oct 11 10:21:06 CEST 2007


Matthieu Brucher wrote:
> That's what I thought, so I don't understand the use of this special
> instruction. The reason I'm asking this is I'm writing a bok and a part of
> it is on Pyrex, and I'd like to be as precise as possible.

Assuming you're writing a "book", I hope you meant "concise". Giving good
examples means leaving out everything that is not necessary to avoid confusion
or mental divergence. So, if you're not writing specifically about how to make
types public and how to export them to external code, you should not use the
syntax you mentioned in your book.

The names given the "cdef public ... [ object NAME, type NAME ]" syntax allow
Pyrex to export the internally mangled names as readable, user-defined names
in a header file to make them available to external code. That's almost all
there is to it.

Stefan



More information about the Pyrex mailing list