C
cipher
Whats the mro (method resolution order) of a setter property (__set__
on a descriptor).
i seem to be experiencing some weird issue with them.
for example
.... def _test(self):
.... return 4
.... def _stest(self)ass # dont change value
.... def _dtest(self,value)ass
.... p=property(_test,_stest,_dtest)5
Why is that being 'overridden' ( by that i mean that it is storing
that value in t's __dict__)
{'t': 5}
why DIDNT the setter get hit?
however, if i specify the metaclass in the class definition it works
just fine...
class test:
__metaclass__=type
def _test(self):
return 4
def _stest(self,value)ass # dont change value
def _dtest(self)ass
p=property(_test,_stest,_dtest)4
why do i have to set the __metaclass__ ? this seems like a bug?
i know that i probably shouldn't worry about this because if a
programmer does want to set my value and it causes an error, thats his
problem.... but this bothers me. whats the point of the __set__ method
then?
Thanks in advanced.
on a descriptor).
i seem to be experiencing some weird issue with them.
for example
.... def _test(self):
.... return 4
.... def _stest(self)ass # dont change value
.... def _dtest(self,value)ass
.... p=property(_test,_stest,_dtest)5
Why is that being 'overridden' ( by that i mean that it is storing
that value in t's __dict__)
{'t': 5}
why DIDNT the setter get hit?
however, if i specify the metaclass in the class definition it works
just fine...
class test:
__metaclass__=type
def _test(self):
return 4
def _stest(self,value)ass # dont change value
def _dtest(self)ass
p=property(_test,_stest,_dtest)4
why do i have to set the __metaclass__ ? this seems like a bug?
i know that i probably shouldn't worry about this because if a
programmer does want to set my value and it causes an error, thats his
problem.... but this bothers me. whats the point of the __set__ method
then?
Thanks in advanced.