Title: Support custom data descriptors in pydoc
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: rhettinger, serhiy.storchaka
Priority: normal Keywords: patch, patch, patch

Created on 2018-12-30 17:48 by serhiy.storchaka, last changed 2019-01-15 08:59 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11366 merged serhiy.storchaka, 2018-12-30 17:52
PR 11366 merged serhiy.storchaka, 2018-12-30 17:52
PR 11366 merged serhiy.storchaka, 2018-12-30 17:52
Messages (2)
msg332753 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-12-30 17:48
Currently pydoc supports only limited set of data descriptors: builtin member and getset descriptors (this covers slot descriptors and structseq member descriptors) and properties. But it does not fully support custom data descriptors.

For example, after implementing accelerators for namedtuple fileds access in issue32492, if P = namedtuple('P', 'x y'), help(P.x) will output the help for the _tuplegetter class instead of the P.x member.

The proposed PR replaces checks for particular types of data descriptors with a general check. It performs also some refactoring and adds a bunch of tests.
msg333651 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-01-15 08:53
New changeset efcf82f94572abcdbd70336e0b2c3d0f4df280bc by Serhiy Storchaka in branch 'master':
bpo-35619: Improve support of custom data descriptors in help() and pydoc. (GH-11366)
Date User Action Args
2019-01-15 08:59:54serhiy.storchakasetkeywords: patch, patch, patch
status: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-01-15 08:53:21serhiy.storchakasetmessages: + msg333651
2018-12-30 17:52:40serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request10700
2018-12-30 17:52:35serhiy.storchakasetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10699
2018-12-30 17:52:31serhiy.storchakasetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10698
2018-12-30 17:48:44serhiy.storchakacreate