Message5422
Jython/Pypy seem more correct than CPython according to the rules on http://docs.python.org/reference/datamodel.html
"For instance bindings, the precedence of descriptor invocation depends on the which descriptor methods are defined. Normally, data descriptors define both __get__() and __set__(), while non-data descriptors have just the __get__() method. Data descriptors always override a redefinition in an instance dictionary. In contrast, non-data descriptors can be overridden by instances."
"A descriptor can define any combination of __get__(), __set__() and __delete__(). If it does not define __get__(), then accessing the attribute even on an instance will return the descriptor object itself. If the descriptor defines __set__() and/or __delete__(), it is a data descriptor; if it defines neither, it is a non-data descriptor."
But I don't think we can fault CPython as it's had this behavior forever |
|
Date |
User |
Action |
Args |
2010-01-10 22:30:45 | pjenvey | set | messageid: <1263162645.9.0.439308555661.issue1534@psf.upfronthosting.co.za> |
2010-01-10 22:30:45 | pjenvey | set | recipients:
+ pjenvey, iamedu |
2010-01-10 22:30:45 | pjenvey | link | issue1534 messages |
2010-01-10 22:30:45 | pjenvey | create | |
|