[Python-Dev] Explicit Lexical Scoping (pre-PEP?) (original) (raw)
Simon Percivall s.percivall at chello.se
Wed Jul 5 14🔞00 CEST 2006
- Previous message: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)
- Next message: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I know this is very similar to the "global.x =" syntax, which was already shot down?, but wouldn't allowing access to a functions locals from within, by prefixing the name, be a good way to disambiguate what happens (instead of any operator to indicate outer scope, like .x = 3 or the like)? I guess this necessitates "global.x =" as well, though.
def foo(): def bar(): foo.x = 3 print x # prints 3
I seem to recall that this syntax has been proposed before, though not in this discussion. But my memory is murky.
//Simon
- Previous message: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)
- Next message: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]