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: