[Python-Dev] Allow assignments in 'global' statements? (original) (raw)

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.



More information about the Python-Dev mailing list