[pyar] Problemas de memory leak
John Rowland Lenton
john.lenton en canonical.com
Mar Oct 5 15:51:29 ART 2010
On Tue, Oct 05, 2010 at 02:53:05PM -0300, Roberto Alsina wrote:
> On Tuesday 05 October 2010 14:40:18 John Rowland Lenton wrote:
> > On Tue, Oct 05, 2010 at 02:35:32PM -0300, Roberto Alsina wrote:
> > > On Tuesday 05 October 2010 14:21:49 John Rowland Lenton wrote:
> > > > agregale __getattr__ (y __setattr__, y __delattr__ si son relevantes),
> > > > que sean copias de (o proxies para) __getitem__ y etc.
> > >
> > >
> > >
> > > Tiene sentido...
> >
> > y cuando dije "copias" quise decir que, si ya tenés __getitem__,
> > después de su definición hagas __getattr__ = __getitem__ :)
>
> 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?
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20101005/68f98b73/attachment.sig>
More information about the pyar
mailing list