[issue13691] pydoc help (or help('help')) should show the doc for help

Nick Coghlan report at bugs.python.org
Sun Apr 9 05:47:46 EDT 2017


Nick Coghlan added the comment:

After reviewing Sanyam's PR at https://github.com/python/cpython/pull/172 I ended up rejecting it as an approach to resolving this issue.

The core problem with the approach is that accessing `_sitebuiltins._Helper` is an implementation detail twice over:

- Python implementations aren't required to have a _sitebuiltins module
- that module isn't required to contain a _Helper class

That means importing it into a general purpose module like pydoc would couple pydoc specifically to the way CPython works, which is something we try to avoid doing.

By contrast, a richer `__help__()` protocol to override the `__doc__` based default behaviour would allow any object to implement it, and _sitebuiltins._Helper could just use that protocol to special case itself.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13691>
_______________________________________


More information about the Python-bugs-list mailing list