[Python-ideas] For-loop variable scope: simultaneous possession and ingestion of cake

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Oct 4 05:25:51 CEST 2008


Bruce Leban wrote:
> Comparing our 
> suggestions, I think local a,b: is a bit more clear than let a = value, 
> b = value: and mine does not force you to initialize the variables.

I tend to favour 'let' because it has a long history
of use in other languages for a very similar purpose,
and will be instantly recognisable to anyone familiar
with those languages.

But it's really only a choice of keyword. If allowing
for non-initialization is desirable, it could be
permitted to say

   let a:
     ...

-- 
Greg



More information about the Python-ideas mailing list