[Python-Dev] closure semantics

Joshua Marshall jmarshal at mathworks.com
Fri Oct 24 11:56:21 EDT 2003


[Timothy]
> It would break any unadorned 'global x' in a nested scope if the
> name did not exist anywhere.
> 
> One option would be to have an "if the name doesn't exist, it it 
> created in module scope".

[Greg Ewing]
> What would be wrong with that? It's what I had in mind.

I believe the <<- operator in the statistical language R
<http://www.r-project.org/> behaves exactly like this.  While not
a compelling reason in itself to adopt this behavior, it's useful
to consider constructs in other successful languages.



More information about the Python-Dev mailing list