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
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
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()
>>