__peter__ at web.de
Mon Jul 12 10:43:36 CEST 2004
Jacek Generowicz wrote:
>>> b) The closure is much clearer, shorter and more convenient.
>>> I have so many of these things that using the class version
>>> would make the code a real mess.
Does the following count as a closure, a class version, or a "real mess"?
def __init__(self, kw):
c = 33
self = Bunch(locals())
self.a += delta
return self.c, self.a
f = make(10)
for i in range(3):
Put another way, could it be that the need for closures is just a request to
get rid of self in disguise?
More information about the Python-list