[Pyrex] Access to nested structures and arrays

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 19 22:55:39 UTC 2007


Anders Gustafsson wrote:

> Somewhat related: Is there some nice way to hinder instantiation of
> classes from outside pyrex code?

Usually this comes up in the context of having an extension
type that needs to be initialised with a pointer to some
C data. One way of doing this is to pass the pointer in to
the __new__ method wrapped in a PyCObject. Since there is
no way of creating a PyCObject from Python code, any
attempt to instantiate the object from Python will lead
to a TypeError.

Let me know if you want an example.

--
Greg



More information about the Pyrex mailing list