Scoping: Is Python and does it matter?

Courageous jkraska1 at san.rr.com
Thu May 25 00:31:57 EDT 2000


> In Python, loops have no scope. Correct?

Correct.

> Does this matter?

I haven't found it to, particularly.

> What do the "experts" do in cases like this?

If you think about it, having various differents "scopes" for
like named variables would be very, very confusing to a novice
programmer, and is probably cleaner in any case to have seperately
named variables, yes?

> searched the website and FAQ for "scoping" to read about the philosophy
> behind the (seeming) lack of scoping for loops. Did I miss it somewhere?

Well, if all of the various Gods and Demigods of Python will allow
me to speak for them (heheh), consider for a moment what I said
above. The simple example you quoted from perl you may find
convenient, but it's my bet that if you conducted an empirical
experiment, your average person off the streets would think it's
quite weird that a name isn't, well, a name, dont'cha know.

:)-



C/



More information about the Python-list mailing list