Re: 'property' builtin does not work for me

2008-05-02 Thread Christian Heimes
Alex Fainshtein schrieb: > As you see, getter works properly. But when assigning to property, setter is > not called, as I would expect. prop is simply replaced with whatever is > assigned and ceased being a property. properties work only for new style classes. You have to subclass your class from

Re: 'property' builtin does not work for me

2008-05-02 Thread Gabriel Genellina
En Fri, 02 May 2008 18:29:57 -0300, Alex Fainshtein <[EMAIL PROTECTED]> escribió: Question: what I am doing wrong? Here, I am defining class with property member: class Test: def getter(self): print "Getter called." return 'a' def setter(self, val): print "Se

'property' builtin does not work for me

2008-05-02 Thread Alex Fainshtein
Question: what I am doing wrong? Here, I am defining class with property member: class Test: def getter(self): print "Getter called." return 'a' def setter(self, val): print "Setter called." prop = property(getter, setter) Then testing it: >>> t = Test() >>