[Pyrex] C-API implementation in Pyrex 0.9.6

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Oct 16 06:49:24 CEST 2007


Stefan Behnel wrote:
> I think the case where
> two modules use the public API of each other should be so rare that I would
> file it under "bad design".

I believe there are legitimate use cases for it. Whenever
you have mutually recursive data structures or functions,
if two modules can't at least privately import the public
interface of the other, you're forced to define the whole
lot in a single module.

Pyrex's parse tree nodes are currently spread over three
modules, and those are really still too large. If I had
to put something of that size in a single module, it would
be unmanageably huge.

> The generated module .h file doesn't currently include anything,

No, because like the .c files, they're designed to be
self-contained. Your proposal would require them to
include the .h files of other imported modules, because
only those .h files know the full story about the layout
of things.

--
Greg



More information about the Pyrex mailing list