lexical closures and python

Julius Welby jwelby at waitrose.com
Thu Sep 6 08:25:47 CEST 2001


I did a quick search and found this:

http://python.sourceforge.net/peps/pep-0227.html

J.

"John Beppu" <beppu at binq.org> wrote in message
news:mailman.999755048.7248.python-list at python.org...
> Hi,
>
> My understanding is that Python does not support lexical closures.
> I've also heard that it should not be expected to appear any time
> in the near future.  Can anyone confirm or deny this?
>
> I want to know, because I'm writing a piece that talks a lot
> about Scheme, and I was comparing it to a lot of scripting languages
> that are out there -- Perl, Python, Ruby, and even JavaScript...
> It seemed strange to me that of all these languages, Python was the
> one that didn't support lexical closures.  (On the other hand, I was
> surpised to find out that JavaScript _did_ support lexical closures).
>
> I'm asking about closures here, because I didn't want to misrepresent
> Python in my writing.  If lexical closures are on the horizon, I'd
> like to know about it.  If not, I guess I could mention that Python
> provides a lambda function, but it's not what a Schemer would expect
> it to be.  I'm trying to be correct, here.
>
> Anyway, I'd appreciate any help I can get.
> Thanks.
>
>





More information about the Python-list mailing list