Message 291365 - Python tracker (original) (raw)

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:

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.