is this a valid import sequence ?

Kay Schluehr kay.schluehr at gmx.net
Sun Jun 24 10:24:44 CEST 2007


On Jun 24, 2:51 am, a... at mac.com (Alex Martelli) wrote:
> Since that global statement is utterly useless
> (it's impossible to read and understand any substantial amount of Python
> code without realizing that accessing a variable not locally assigned
> means you're accessing a global, so the "self-documenting" character
> claimed for that redundancy is quite fallacious), it IS perfectly
> suitable to take away, and so it's at least a serious imperfection.

Allow me a pun: self is pretty self-documenting.

With Python 3.0 we finally get even two declarations for accessing a
name for assignment from an outer scope. Maybe the Python Zen should
be altered in the following way:

- Namespaces are one honking great idea -- let's do more of those!
+ Accessor declaratives are one honking great idea -- let's do more of
those!

Kay




More information about the Python-list mailing list