[pyar] Problemas de memory leak

Roberto Alsina ralsina en netmanagers.com.ar
Mar Oct 5 15:55:47 ART 2010


On Tuesday 05 October 2010 15:51:29 John Rowland Lenton wrote:
> > Hice así:
> > 
> >         def __init__(self):
> >             self.__getattr__ = self.__getitem__
> >             self.__setattr__ = self.__setitem__
> >             self.__delattr__ = self.__delitem__
> > 
> >
> > Y quedó andando bien.
> 
> de curioso: por qué en la instancia y no en la clase?

Ya sabiendo que en la instancia no funciona:

>>> class C(dict):
...     __getattr__=__getitem__
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in C
NameError: name '__getitem__' is not defined



More information about the pyar mailing list