On Thu, Sep 3, 2015 at 4:13 PM, Mark Lawrence <breamore...@yahoo.co.uk> wrote: > On 03/09/2015 20:47, Ian Kelly wrote: >> >> On Thu, Sep 3, 2015 at 1:05 PM, <t...@freenet.de> wrote: >>> >>> Or does anyone really name a global var xxx and a function var xxx? >>> I am sure no one at all will do it. I dont want read such a code. >> >> >> Intentionally, it's probably rare. But if I'm adding a new variable, I >> shouldn't need to first make sure that it's safe to do so by scanning >> over the entire file to make sure that the name hasn't already been >> used elsewhere in the opposite scope. >> > > I'm just curious as I've never used it myself, but how does nonlocal > https://docs.python.org/3/reference/simple_stmts.html#the-nonlocal-statement > fit into this?
I don't know whether the proposal also applies to nonlocals, but such conflicts would be less of an issue since you would only need to check the outermost function scope (and also, nested functions aren't really all that common). -- https://mail.python.org/mailman/listinfo/python-list