problem with Python class creating

dmitrey dmitrey.kroshko at scipy.org
Fri Oct 19 03:22:07 EDT 2007


Thanks all for these detailed explanations.
On Oct 18, 10:48 pm, Bruno Desthuilliers
<bdesth.quelquech... at free.quelquepart.fr> wrote:
> dmitrey a écrit :
> Not unless these classes define their own initializers. But that's
> another problem
>
> > and there are lots of
> > those ones)
>
> > class MyClass:
> >     def __init__(self):
> >         iterfcn = lambda *args: ooIter(self)
>
> The real problem is that you create one anonymous function *per instance*.
No, it's not a problem - it's desired behaviour.
Regards, Dmitrey




More information about the Python-list mailing list