Macros in Python? (PEP 310)

Dominic oblivious at web.de
Sat Apr 12 11:48:19 CEST 2003


> If this isn't what you are trying to do, could you clarify what's
> missing?

Your approach is not flexible enough to wrap
arbitrary functions because _y is hardcoded.
(Or am I wrong?)
Using the generator-hack you don't even
need to wrap the code you want
to execute into a function (!)
But it is still guranteed that e.g. setuid
is set to it's old value.

I've been curious about how to
circumvent try: finally: in a general and
with minimum effort.

PEP305 and the generator based hack
have been very close to what I was
looking for.

Ciao,
  Dominic





More information about the Python-list mailing list