Having the "global" keyword semantics changed to be "lexically global"
would break in the cases that "global" is used on a name within a
nested scope that has an enclosing scope with the same name. I would
suppose that actual instances in real code of this would be rare.
Consider:
>>> x = 1
>>> def f() :
... x = 2
... def inner() :
... global x
... print x
... inner()
...
>>> f()
1
Under the proposed rules:
>>> f()
2
PEP 227 also had backwards incompatibilities that were similar and I
suggest handling them the same way by issuing a warning in these cases
when the new semantics are not being used (
i.e. no "from __future__").