a = b = 1 just syntactic sugar?

Ed Avis ed at membled.com
Mon Jun 9 16:29:28 EDT 2003


martin at v.loewis.de (Martin v. =?iso-8859-15?q?L=F6wis?=) writes:

>>>For example, what is the meaning of
>>>
>>>a = lambda b : return b > 0

>Why not the same as
>
>def fresh(b):
>  return b
>a = fresh > 0

Hmm, I see what you mean.  Other articles on this thread have also
demonstrated ambiguous parses.  It does look like the only way to have
a simple_stmt inside a lambda is to have some kind of bracketing, and
that is inconsistent with the rest of the language (which uses
indentation and newline) and in particular with ordinary function
definitions.

-- 
Ed Avis <ed at membled.com>




More information about the Python-list mailing list