[Python-Dev] Re: closure semantics

Alex Martelli aleaxit at yahoo.com
Sun Oct 26 05:46:53 EST 2003

On Saturday 25 October 2003 20:05, David Eppstein wrote:
> > One person here brought up (maybe David Eppstein) that they used this
> > approach for coding up extensive algorithms that are functional in
> > nature but have a lot of state referenced *during* the computation.
> refactoring in general, but you convinced me that using an object to
> represent shared state explicitly rather than doing it implicitly by
> nested function scoping can be a good idea.

Great testimony, David -- thanks!!!

So, maybe, rather than going out of our way to facilitate coding very
large and complicated closures, it might be better to keep focusing
on _simple_, small closures as the intended, designed-for use case,
and convince users of complicated closures that refactoring, as
David has done, into OO terms, can indeed be preferable.


More information about the Python-Dev mailing list