Guido van Rossum wrote: > [...] > Maybe "global x in f" would work? > > def outer(): > x = 1 > def intermediate(): > x = 2 > def inner(): > global x in outer > x = 42 > inner() > print x # prints 2 > intermediate() > print x # prints 42 Why not make local variables attributes of the function, i.e. replace: def inner(): global x in outer x = 42 with: def inner(): outer.x = 42 Global variables could then be assigned via: global.x = 42 Could this be made backwards compatible? Bye, Walter Dörwald
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4