Statements vs. expressions (was Re: Loop-and-a-half (Re: Curious assignment behaviour)

Ville Vainio vvainio at karhu.tp.spt.fi
Tue Oct 16 03:31:35 EDT 2001


huaiyu at gauss.almadan.ibm.com (Huaiyu Zhu) writes:

> Agreed generally.  A clarification, though: the proposal does not allow
> statements in expressions; it allows statements _between_ conditional
> keywords and the corresponding expressions, like
> 
> while [ <statements> ; ] <expression> :  <suite>
> if [ <statements> ; ] <expression> :  <suite>

By the way, what is the big win with having statements in the
language, as opposed to just having expressions (possibly returning
'Unit' or something similar)?

-- 
Ville Vainio - http://www.tp.spt.fi/~vvainio - ICQ #115524762
 Wild geese have no intention to cast a reflection
 Water has no mind to assume their form



More information about the Python-list mailing list