Le Mercredi 17 Mai 2006 06:17, [EMAIL PROTECTED] a écrit : > I want the fact that the fields are > not strings to be invisible to the client programmers. You should use properties then.
In [12]: class mystr(str) : pass ....: In [13]: class myrow(object) : ....: getX = lambda s : s._x ....: setX = lambda s, v : setattr(s, '_x', mystr(v)) ....: X = property(getX, setX) ....: ....: In [14]: r=myrow() In [15]: r.X = 'toto' In [16]: r.X Out[16]: 'toto' In [17]: type(r.X) Out[17]: <class '__main__.mystr'> -- _____________ Maric Michaud _____________ Aristote - www.aristote.info 3 place des tapis 69004 Lyon Tel: +33 426 880 097 -- http://mail.python.org/mailman/listinfo/python-list