Let's Talk About Lambda Functions!

Greg Ewing see_reply_address at something.invalid
Mon Aug 5 06:34:54 CEST 2002


John Roth wrote:

> "Huaiyu Zhu" <huaiyu at gauss.almadan.ibm.com> wrote in message
> news:slrnakme8c.bn9.huaiyu at gauss.almadan.ibm.com...
>>    x = y + (
>>def (z):
>>    if z: return 'True z'
>>    else: return 'False z'
>>        )('arg for anonymous function') + ' & additional expression
>>
> terms.'
> 
> As Bengt points out at more depth, this would be a syntax error,
> because there is no dedent following the function.


When the parser gets to the closing ")", it could do what it
does at the end of a file, and assume there are enough implied
dedents to get back to the right level.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list