[Pyrex] [Cython-dev] cdef private class ... ?

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jan 29 02:47:31 CET 2008


Stefan Behnel wrote:
> I looked through the code to see how this would work. Apparently, all cdef
> types and cdef functions in Pyrex/Cython *are* "private" by default
> (entry.visibility). But only classes are exported to Python space. How's that
> for consistency!

The public/private distinction isn't about visibility to Python,
it's about visibility to external C code.

Visibility to Python is determined by what kind of thing it is.
C types and cdef functions only exist in the C world and are
therefore not visible to Python. Def functions and extension types
are Python objects, so they are visible to Python.

It would be better to find another word for this distinction,
such as 'hidden' or 'internal', if it's really desirable -- and
I'm not yet convinced that it is.

--
Greg



More information about the Pyrex mailing list