This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [regression] inspect.getdoc not returning docstring.
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: mbussonn, terry.reedy
Priority: normal Keywords:

Created on 2020-05-11 03:56 by mbussonn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg368603 - (view) Author: Matthias Bussonnier (mbussonn) * Date: 2020-05-11 03:56
In python 3.8:

```
>>> class A(object):
...     """standard docstring"""
...     pass
...
>>> import inspect
>>> inspect.getdoc(A())
'standard docstring'
```

In 3.9:

```
$ python
Python 3.9.0a6+ (heads/master:5b956ca42d, May 10 2020, 20:31:26)
[Clang 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> class A(object):
KeyboardInterrupt
>>> class A(object):
...     """standard docstring"""
...     pass
...
>>> import inspect
>>> inspect.getdoc(A())
>>>
```
msg368605 - (view) Author: Matthias Bussonnier (mbussonn) * Date: 2020-05-11 04:05
That will break a lot o the interactive usage for the scientific ecossytem Imho, 

For example anyone that get a Pandas Dataframe and try to get help on it either via help(df), or `df?` in IPython/Jupyter.

Might be purposeful (https://bugs.python.org/issue40257)
msg368992 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-16 00:58
This change was part of #40257 and is being discussed there (where I suggested reverting it).
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84767
2020-05-16 00:58:58terry.reedysetstatus: open -> closed

nosy: + terry.reedy
messages: + msg368992

resolution: duplicate
stage: resolved
2020-05-11 04:05:13mbussonnsetmessages: + msg368605
2020-05-11 03:56:39mbussonnsetcomponents: + Interpreter Core
versions: + Python 3.9
2020-05-11 03:56:20mbussonncreate