A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039500.html below:

[Python-Dev] replacing 'global'

[Python-Dev] replacing 'global' [Python-Dev] replacing 'global'Neal Norwitz neal at metaslash.com
Sat Oct 25 10:29:32 EDT 2003
On Sat, Oct 25, 2003 at 04:03:17PM +0200, Alex Martelli wrote:
> 
> Yes!  If the compiler needs to be aware of global assignments (which IS
> a good idea) we can do so by either introducing a new "operator keyword"

One thing that I've always wondered about, why can't one do:

        def reset_foo():
            global foo = []     # declare as global and do assignment

As Alex pointed out in another mail (I'm paraphrasing liberally):
redundancy is bad.  By having to declare foo as global, there's
a guaranteed redundancy of the variable when foo is also assigned.

I don't know if this solution would make Alex dislike global less.
But it changes global to look more like a statement, rather than 
a declaration.

Neal

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4