recursion error using setattr and getattr

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Jun 7 20:44:10 CEST 2007


En Thu, 07 Jun 2007 08:23:48 -0300, Nathan Harmston  
<ratchetgrid at googlemail.com> escribió:

> I m trying to implement an object which contains lazy" variables. My
> idea is to alter the getattr and the setattr methods. However I keep
> on getting a recursion error.

Instead of setattr/getattr, use a property, and you'll get much cleaner  
code.

-- 
Gabriel Genellina




More information about the Python-list mailing list