I was doing some tricks with metaclasses and descriptors in Python 2.2 and stumbled on the following: >>> class test(object): ... a = property(lambda: 1) ... >>> print test.a <property object at 0x01504D20> >>> print test.a.__set__ <method-wrapper object at 0x01517220> >>> print test.a.fset None What this means in practice, is that if I want to test if a descriptor is read-only I have to have two tests: One for custom descriptors, checking that getting __set__ does not barf and another for property, checking that fset returns None. So, why doesn't getting __set__ raise AttributeError in the above case? Is this a bug? If it's not, it sure is a (minor) feature request from my part :-) With my best regards, G. Rodrigues
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4