[Pyrex] C-API implementation in Pyrex 0.9.6

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Oct 16 09:30:19 CEST 2007


I've thought of another reason for keeping the distinction
between "public" and declaration in a .pxd file.

When you don't declare something public, Pyrex uses a
mangled fully-qualified name for it, so that things with
the same name in different namespaces remain separate.
You can safely use things from cimported namespaces
according to the usual Python rules without fear of
collisions.

When you declare something public, Pyrex uses the name
you give it directly as its name in C code. This makes
it easy for external C code to use it, but places some
un-Python-like restrictions on the names, such as not
having two public things with the same name, even if
they live in different Pyrex modules.

So I think that merging these two concepts together
without the consent of the programmer would be a bad
move.

--
Greg



More information about the Pyrex mailing list