Trouble with property

Gabriel Genellina gagsl-py at
Tue Oct 24 03:16:58 CEST 2006

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 

Gabriel Genellina
Softlab SRL 

Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! -

More information about the Python-list mailing list