declaration of variables?

Andrew Bennetts andrew-pythonlist at puzzling.org
Sun Feb 16 18:29:11 EST 2003


On Sun, Feb 16, 2003 at 08:24:21PM +0100, Andr? Jonsson wrote:
> Alex Martelli wrote:
> >>:-)  I mostly meant that Python seems more "aware" than most other
> >>:languages of
> >>usability and readability. Do those not count?
> >
> >Of course; they're the main reasons Python avoids declarations.
> 
> Dare I quote the Python Zen? "Explicit is better than implicit". I concurr, 
> declaring a variable explicitly is better than just implicitly using, 
> seemingly arbitrary, ones.

All variables assigned in a function's scope are local, unless explicitly
declared global.  That's plenty explicit enough, especially when you
consider more Python Zen: "Although practicality beats purity."

-Andrew.






More information about the Python-list mailing list