Closures python,scheme,ruby

Michael Geary Mike at Geary.com
Thu Jul 15 13:01:35 EDT 2004


Jacek Generowicz wrote:
> [extensive description of the situation with Python closures]

That's a great explanation, Jacek. Very informative.

> It works, but it severely reduces the elegance and convenience
> of closures. If you appreciate closures, you are likely to consider
> this a big pain. If you don't appreciate closures you probably
> can't see what the fuss is about, and are likely to tell people that
> stateful functions in Python should be implemented as methods
> of classes.
>
> I happen to appreciate closures.

I really like closures too. They can make for some very simple and elegant
code.

For anyone who wonders what the fuss is about, I posted some Acrobat
JavaScript code a while back with two versions of a piece of code, one with
closures and one with objects:

http://groups.google.com/groups?selm=109eg534ca5cj8b%40corp.supernews.com

-Mike





More information about the Python-list mailing list