Closures python,scheme,ruby

Michael Geary Mike at
Thu Jul 15 19:01:35 CEST 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

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:


More information about the Python-list mailing list