Usually when we want to make a variable/def/class etc global, we can just 
declare `global v` at the beginning, but I feel like there could be a better 
way to do that.

So my idea is to allow doing stuff like

`global a = 3`

or

`nonlocal def x(): ...`
 
or even

`for global i in []: ...`

in addition to the current `global` statement to allow backwards compatibility 
What do you think?
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/XHQM7BKAHTFIACHSAPHEVITIQ6BWOOHF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to