[Python-ideas] the optional "as" statement inside "if" statements

Masklinn masklinn at masklinn.net
Wed Jul 4 19:25:01 CEST 2012


On 2012-07-04, at 18:19 , Matt Joiner wrote:

> There's no point doing this in Python since scoping is function-level
> and not lexical. Just move the assignment to the line preceding the if
> statement.

Technically, scoping is *both* lexical and function-level (as opposed
to block-based), although writing to a lexical scope is slightly more
complex than in other languages with mutable lexical scopes.



More information about the Python-ideas mailing list