Proposal: local variable declarations and type advice

Greg Ewing greg at cosc.canterbury.ac.nz
Tue Feb 26 23:03:55 EST 2002


Paul Rubin wrote:
> 
>      odds = [local x for x in range(10) if x%2 != 0]

That should be

   odds = [x for local x in range(10) if x%2 != 0]

The first thing in a list comprehension is in general an
expression, not just a variable.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list