4 ms·
It's not as bad as I thought, but Python doesn't actually have lexical scope, not really. But the LEGB rules mean that it should still work as you expect.
by qwertyuiop924 10y ago
It's not as bad as I thought, but Python doesn't actually have lexical scope, not really. But the LEGB rules mean that it should still work as you expect.
- TJSomething 10y agoIt does if you're using Python 3, which has the nonlocal keyword for lexical scope.
- qwertyuiop924 10y agoFinally. But that should really be default.