[Twisted-Python] python properties in twisted don't work

Gabriel Rossetti gabriel.rossetti at arimaz.com
Thu Dec 18 10:39:59 EST 2008


Jean-Paul Calderone wrote:
> On Thu, 18 Dec 2008 14:35:00 +0100, Gabriel Rossetti 
> <gabriel.rossetti at arimaz.com> wrote:
>> Hello everyone!
>>
>> I have a problem, if I try to use python property in a twisted 
>> program, it doesn't really work...the accessor works but as soon as I 
>> use the mutator, it no longer uses the property (and doesn't set the 
>> "real" variable. I tried an example without twisted, it works, and 
>> with the twisted example it doesn't... does anyone know what is going 
>> on? Thank you!
>
> Property setters only work on new-style classes.  Many classes defined by
> Twisted are classic, so they will not work with properties unless you 
> make
> your subclass new-style, which you can do by mixing in object.
>
> Jean-Paul
Thank you, I wasn't aware of that, I'll add object when inheriting from 
any Twisted stuff then.

Gabriel




More information about the Twisted-Python mailing list