a = b = 1 just syntactic sugar?

Martin v. Löwis martin at v.loewis.de
Mon Jun 9 01:35:45 CEST 2003


Ed Avis <ed at membled.com> writes:

> I've given several examples, a possible grammar rule (use simple_stmt)
> and a semantics (the same as a named def).

That would be an incompatible change. Currently

x = lambda:2
print x()

prints "2". Under your change, this would be the same as

def anon():
  2
x = anon
print x()

so it would print "None" instead.

Regards,
Martin




More information about the Python-list mailing list