Modifying func_closure

Jacek Generowicz jacek.generowicz at cern.ch
Mon Jul 12 09:25:19 CEST 2004


Ville Vainio <ville at spammers.com> writes:

> Closures are indeed much handier than classes for many "in-place",
> lightweight operations. Implementing a local class is often too
> heavyweight, esp. if the creator has to implement __init__ as well as
> another method that does useful work.

... which is pretty much guaranteed ... if you didn't have to
implement __init__ then it wouldn't be a closure (unless I'm missing
some subtle variation on the theme).

> Closures are well in line with the "modern" way of Pythoning,

Boy am I glad to hear you say that. I sometimes get the impression
that I'm the only heretic bold enough to suggest publically that
Classes are all you need in Python :-)

> So yes, please, can we have our mutable closures now?

Wow, if I hear any more of these comments, I might just have to start
thinking about considering to entertain the possibility of maybe
writing a PEP. (Do you note any hesitation or reluctance on my part ? 
:-)



More information about the Python-list mailing list