At Monday 23/10/2006 20:28, Odalrick wrote:

I'm having some trouble with using property. This class is supposed to
represent a rectangle that can never be outside an area.

class ConstrainedBox:
# The property that is causing grief
        linear_size = property( _get_linear_size, _set_linear_size )

By adding some logging I found out that _set_linear_size never is
called, so the rectangle remains the default size forever.

You must use a new-style class for properties to work. That is: class ConstrainedBox(object):

--
Gabriel Genellina
Softlab SRL
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to