[issue40257] Improve the use of __doc__ in pydoc

Serhiy Storchaka report at bugs.python.org
Mon May 11 04:16:37 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

help(1) as well as help(int) output the help for int. The only difference is that the former has the first line "Help on int object:", and the latter -- "Help on class int in module builtins:".

If IPython wants to output the help on the instance, it should change the implementation of `?` and `??`. It would be better if it correctly attribute the source of the docstring: the object itself, its class or its superclass. It was difficult to distinguish these cases before, now it is easier.

By the way, I just tried IPython 5.5.0 with Python 3.6.9, and it does not output the docstring either:

In [1]: a = 1

In [2]: a??
Type:        int
String form: 1

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40257>
_______________________________________


More information about the Python-bugs-list mailing list