3 ms·
"Python doesn't have lexical scope" Can you explain why https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Closures https://en.wikipedia.org/wiki/Python
by dalke 11y ago
"Python doesn't have lexical scope"
Can you explain why https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Closures https://en.wikipedia.org/wiki/Python_syntax_and_semantics#Cl... says:
> Python has had support for lexical closures since version 2.2. ... Python's syntax, though, sometimes leads programmers of other languages to think that closures are not supported. Variable scope in Python is implicitly determined by the scope in which one assigns a value to the variable, unless scope is explicitly declared with global or nonlocal.
?