Pyrex - The speed of Python with the clarity of C?

Terry Reedy tjreedy at udel.edu
Fri May 21 14:38:26 EDT 2004


"Peter Hansen" <peter at engcorp.com> wrote in message
news:juidnTjQubr1szPd4p2dnA at powergate.ca...
> SeeBelow at SeeBelow.Nut wrote:
> > Am I wrong about this?  Perhaps I don't understand how Pyrex works.
>
> Look at the primes.pyx example.  There's a link just below it
> (above the Language Details section) showing the C code it is
> compiled to (and which is in turn compiled to machine code).  True,
> there are many calls to the Python/C interface APIs, but there is
> also "pure" C code in there.

In particular, lines 5-15 of the Python code, the 'guts' of the algorithm,
are compiled to pure C with no interface calls.

TJR







More information about the Python-list mailing list