[pyar] Problemas de memory leak
Juanjo Conti
jjconti en gmail.com
Mar Oct 5 15:05:10 ART 2010
2010/10/5 Roberto Alsina <ralsina en netmanagers.com.ar>:
> ''' By default, RSON objects are dictionaries that
> allow attribute access to their existing contents.
> '''
Muy copado este feature. Adjunto un decorador que implementa la idea
de John. La clase que se decore debe tener los métodos
__[set|get|del]item__.
Se usa así:
>>> d = MyDict()
>>> d['a'] = 1
>>> d['b'] = 2
>>> d.a
1
>>> d.b
2
>>> d.algo = 0
>>> d.keys()
['a', 'b', 'algo']
--
Juanjo Conti
blog: http://www.juanjoconti.com.ar
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: attr2item.py
Type: text/x-python
Size: 206 bytes
Desc: no disponible
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20101005/c1d3408f/attachment.py>
More information about the pyar
mailing list