Objects in Python

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu Aug 23 00:11:52 EDT 2012


On Thu, 23 Aug 2012 12:02:16 +1000, Chris Angelico wrote:

> 2) Related to the above, you can infinitely nest scopes. There's nothing
> wrong with having six variables called 'q'; you always use the innermost
> one. Yes, this can hurt readability

Well, there you go. There *is* something wrong with having six variables 
called 'q'.

Namespaces and scopes are work-arounds for the fact that, while there are 
an infinite number of possible names, most of the good ones are already 
taken.

Namespaces and scopes mean that I can use a name "q" even though I've 
already used it for something else, but there is still cost to re-using 
names (even if that cost is sometimes trivial).


-- 
Steven



More information about the Python-list mailing list