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.

Author serhiy.storchaka
Recipients gvanrossum, levkivskyi, ncoghlan, serhiy.storchaka, veky, yselivanov
Date 2020-04-12.09:27:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Inheritance of docstrings was added in issue15582. It works good for class members, but I now realized that doing it for class itself was a mistake. For example:

>>> import wave
>>> help(wave.Error)
Help on class Error in module wave:

class Error(builtins.Exception)
 |  Common base class for all non-exit exceptions.
 |  Method resolution order:
 |      Error
 |      builtins.Exception
 |      builtins.BaseException
 |      builtins.object

I fixed many similar issues by adding docstrings to classes, but there are even more exception classes and other classes in the stdlib for which help() gives incorrect description. I don't remember a single case when inheritance of the docstring was helpful.

Note that help() outputs the list of base class right after the docstring, so it is not hard to give an additional information, especially in interactive browser mode. If you want to inherit a docstring, you can do it explicitly:

    __doc__ = BaseClass.__doc__
Date User Action Args
2020-04-12 09:27:19serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, ncoghlan, yselivanov, veky, levkivskyi
2020-04-12 09:27:19serhiy.storchakasetmessageid: <>
2020-04-12 09:27:19serhiy.storchakalinkissue40257 messages
2020-04-12 09:27:18serhiy.storchakacreate