[ python-Bugs-1758696 ] Documentation of descriptors needs more detail

SourceForge.net noreply at sourceforge.net
Mon Jul 23 07:35:32 CEST 2007


Bugs item #1758696, was opened at 2007-07-22 22:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1758696&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: L. Peter Deutsch (lpd)
Assigned to: Nobody/Anonymous (nobody)
Summary: Documentation of descriptors needs more detail

Initial Comment:
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.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1758696&group_id=5470


More information about the Python-bugs-list mailing list