[Python-ideas] Tweaking closures and lexical scoping to include the function being defined

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Sep 29 23:24:15 CEST 2011

Nick Coghlan wrote:
> As Guido noted, default argument *names* refer to
> ordinary locals, and hence exhibit the same rebinding behaviour as
> pre-nonlocal closure references (i.e. reassignments don't persist
> across calls, only mutations do). Since we expressly *don't* want that
> behaviour,

Are you sure we don't? The ability to persistently re-assign
the name is not needed to address the main use cases under
consideration, as I understand them to be. In fact, disallowing
assignment to the name at all would be fine by me. Hence I
would be +0 on using 'const' as the keyword.


More information about the Python-ideas mailing list