No macros in Python

Michael Hudson mwh at python.net
Tue Dec 17 08:31:51 EST 2002


Greg Ewing <see_reply_address at something.invalid> writes:

> Carl Banks wrote:
> 
> > I don't need it in Python because exceptions
> > are a much better method here.  God knows the Python source code could
> > use it.
> 
> 
> Which gives me a thought. Pyrex could be considered, among
> other things, a very fancy macro processor which inserts
> exception handling into C code. So... what if the Python
> core were written in Pyrex...

This has occurred to me before now.  Or rather, the comedy ineptness
of the C preprocessor has made me consider the idea of creating the C
source to Python by munging template files.  The munging could be done
in m4 or something, but frankly I'd rather do it in Python.  Using
Pyrex would take this idea to one possible extreme.

(a specific example would be creating two versions of eval_frame: one
that had the code necessary for tracing, and one that didn't, on the
theory that the latter would run a little quicker).

Cheers,
M.

-- 
  US elections
  For those of you fearing that the rest of the world might be 
  making fun of the US because of this: Rest assured, we are.
         -- http://www.advogato.org/person/jameson/diary.html?start=12



More information about the Python-list mailing list