[Python-Dev] Extended Function syntax

Guido van Rossum guido@python.org
Thu, 23 Jan 2003 09:38:06 -0500


> > > In particular:
> > > 
> > >    def name(arg, ...) [expr1, expr2, expr3]:
> > >        ...body...
> > > 
> > > would be equivalent to (some variation on):
> > > 
> > >    def name(arg, ...):
> > >      ...body...
> > > 
> > >    name=expr1(expr2(expr3(name)))
> > 
> > With Michael's patch (which indeed still works) it's actually 
> > 
> >     name = expr3(expr2(expr1(name)))
> 
> I can't remember if that was deliberate or accidental.  I think
> deliberate.

It certainly surprises me less -- this is left-to-right (applying
expr1 first) which is goodness.

--Guido van Rossum (home page: http://www.python.org/~guido/)