Issue 936774: pydoc data descriptor unification (original) (raw)
This patch to pydoc unifies the display of data descriptors, including slots, properties, and custom descriptors.
The changes are as follows:
* removed special handling of properties
* added special handling of data descriptors - All
data descriptors are grouped together in a section. For each item, the attribute name and doc string, if present, is displayed.
* disabled display of __slots__ attribute - since
slots are descriptors, they are listed in the section described above
A complementary change to Python will be to support setting of doc strings on slots. The proposal is to use dictionary values when slots is a dictionary object, as suggested in Guido's "Unifying types and classes".
The rationale for these changes is described in <http://mail.python.org/pipermail/python-dev/2004-April/044213.html>.
Logged In: YES user_id=469548
Checked in as rev 1.102 of pydoc.py, with some minor changes:
- renamed _docproperty to _docdescriptor
- made names of data descriptors bold, and put a newline between each of them, to be consistent with the rest of the methods and data