a little trap revealed (was Re: Let's Talk About Lambda Functions!)

Gerald Squelart squelart at hotmail.nospam.com
Mon Jul 29 20:34:49 EDT 2002


"Steve Holden" <sholden at holdenweb.com> wrote
> "Michele Simionato" <mis6 at pitt.edu> wrote
> > why Guido decided to keep
> > the distinction between statements (with no value returned) and
> > expressions ? what are the advantages ? is it a matter of personal
> > taste ?
> He made that decision for the same reason he decided not to allow
> assignments inside expressions. You can find the justification in the FAQ if
> you look for it ... 6.30: Why can't I use assignment in an expression.

Static FAQ is there: http://www.python.org/doc/FAQ.html
6.30 is there: http://www.python.org/doc/FAQ.html#6.30

However, as you point out, 6.30 is 'Why can't I use an assignment in an
expression?', whereas the question asked here is 'Why is there a distinction between
statements and expressions?'.
You write 'He made that decision for the same reason...'; how do you know this? I
had a quick look, but didn't see anything about the question asked by Michele. It
may be a good thing to add to the FAQ...

Cheers,
Gerald.





More information about the Python-list mailing list