[Python-Dev] Re: closure semantics
Terry Reedy
tjreedy at udel.edu
Thu Oct 23 00:03:29 EDT 2003
"David Eppstein" <eppstein at ics.uci.edu> wrote in message
news:eppstein-567571.16030622102003 at sea.gmane.org...
> If I implement it as a collection of methods of an object, I then
have
> to include a separate function which creates an instance of the
object
> and immediately destroys it. This seems clumsy and also doesn't fit
> with my intuition about what objects are for (representing
persistent
> structure). Also, again, modularity is violated -- outside code
should
> not be making instances of this object or accessing its methods.
So why not define the class inside the master function to keep it
private?
For a complex algorithm, re-setup time should be relatively
negligible.
Terry J. Reedy
More information about the Python-Dev
mailing list