Issue 1758696: Documentation of descriptors needs more detail (original) (raw)

Doc section 3.4.2.3 says:

Data descriptors define both get() and set(). Non-data descriptors have just the get() method.

This is not quite detailed enough. By experiment, the next paragraph is the whole story, which I think should replace the above two sentences.

A descriptor can define any combination of get(), set(), and delete(). If it does not define get(), then accessing the attribute (a.x) will return the descriptor itself. If the descriptor defines set() and/or delete(), it is a data descriptor; if it defines neither, it is a non-data descriptor.

I realize that some combinations of get(), set(), and delete() are not very useful, but the documentation should cover all the cases.