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/2006-June/066355.html below:

[Python-Dev] Allow assignments in 'global' statements?

[Python-Dev] Allow assignments in 'global' statements? [Python-Dev] Allow assignments in 'global' statements?Josiah Carlson jcarlson at uci.edu
Thu Jun 22 09:30:37 CEST 2006
Talin <talin at acm.org> wrote:
> 
> I'm sure I am not the first person to say this, but how about:
> 
>     global x = 12
> 
> (In other words, declare a global and assign a value to it - or another 
> way of saying it is that the 'global' keyword acts as an assignment 
> modifier.)

If we allow that, then we necessarily need to allow:

    global x, y, z = 12, 13, 14

... while I have also thought to myself 'it would be really nice to be
able to assign to a global when I declare a value to be global', it has
usually been a case of early optimization for me.  I don't really know
how I feel about either example above, I'd probably be +0.

 - Josiah

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