No macros in Python

Michael Hudson mwh at python.net
Wed Dec 18 08:45:50 EST 2002


Bernhard Herzog <bh at intevation.de> writes:

> Michael Hudson <mwh at python.net> writes:
> 
> > jepler at unpythonic.net writes:
> > 
> > > I'd rather just write 'with lock: suite'.
> > 
> > Right.  Here's a proposal:
> > 
> > with <exp>:
> >   <suite>
> > 
> > is equivalent to
> > 
> > _x = <exp>
> > _x.__enter__()
> > try:
> >   <suite>
> > finally:
> >   _x.__exit__()
> 
> See also this thread on python-dev:
> http://mail.python.org/pipermail/python-dev/2002-March/021369.html

Yes, I remember that one.  It's partly remembering that, and the way
that nothing has happened since that motivates me this time.

> I posted a very similar proposal there that also tried to allow for
> loops:
> http://mail.python.org/pipermail/python-dev/2002-March/021444.html

Interesting, but, to me at least, that seems a bit overcomplicated.
The perfect is the enemy of the good and all that.

> Barry Warsaw seemed to like approach too :)

If I wanted to convince Guido, I'd probably keep quiet about that ;-)

Cheers,
M.

-- 
  I also fondly recall Paris because that's where I learned to
  debug Zetalisp while drunk.                          -- Olin Shivers



More information about the Python-list mailing list