On Thu, Sep 3, 2015 at 1:47 PM, Ian Kelly <[email protected]> wrote:
> On Thu, Sep 3, 2015 at 1:05 PM, <[email protected]> wrote:
>
>> But then I ask you from high-level point of view
>> (if my high level view is correct at all):
>> Would you remove this keyword if it would be technically possible
>> or is good for you from high level point of view to have a keyword "global"?
>
> Provided that the proposal doesn't open up the possibility of
> unintentionally creating a global variable where I wanted a local, I'd
> be okay with it.
Let me clarify that I'd be okay with making the keyword optional. It
should probably still be kept around for the occasional use like this:
exec("""def function():
global {0}
{0} = 42
""".format('x'))
where the compiler would have little hope of figuring out that the
variable was meant to be global without it.
--
https://mail.python.org/mailman/listinfo/python-list