Grouping code by indentation - feature or ******?

Mike Meyer mwm at mired.org
Sat Mar 26 17:52:17 EST 2005


James Stroud <jstroud at mbi.ucla.edu> writes:

> On Friday 25 March 2005 08:39 am, Ivan Van Laningham wrote:
> Why do we need : at the end of our if and for loops? I spend approximately 6 
> minutes/100 lines of code going back and finding all of the times I missed :. 
> Is it for cheating?

Because newlines are optional statement terminators. Without the ':',
the end of the statement would depend on the state of the lexer, which
isn't something you want to impose on people.

      <mike
-- 
Mike Meyer <mwm at mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.



More information about the Python-list mailing list