[Pyrex] cdef class __init__ && mixed used of python and c variables

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Aug 23 07:29:46 UTC 2006


Test Drive wrote:
> I have tried "cdef 
> object j", however in that case user will not be able to use the j when 
> user will create an instance of the object Test.

You want 'cdef public int j' to expose it to Python
code. Or 'cdef readonly int j' if you don't want
them to be able to write to it.

Like builtin types, Pyrex extension types don't have
a dict, so you can't assign arbitrary attributes to
them.

--
Greg



More information about the Pyrex mailing list