Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4333d8b

Browse files
committed
Issue #15582: Add a whatsnew entry for inspect.getdoc() changes in 3.5.
Patch by Martin Panter.
1 parent 61d5aab commit 4333d8b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Doc/library/inspect.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ Retrieving source code
423423
a class, a method, a property or a descriptor, retrieve the documentation
424424
string from the inheritance hierarchy.
425425

426+
.. versionchanged:: 3.5
427+
Documentation strings are now inherited if not overridden.
428+
426429

427430
.. function:: getcomments(object)
428431

Doc/whatsnew/3.5.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,13 @@ Changes in the Python API
11391139
``True`` when finding the empty string and the indexes are completely out of
11401140
range. See :issue:`24284`.
11411141

1142+
* The :func:`inspect.getdoc` function now returns documentation strings
1143+
inherited from base classes. Documentation strings no longer need to be
1144+
duplicated if the inherited documentation is appropriate. To suppress an
1145+
inherited string, an empty string must be specified (or the documentation
1146+
may be filled in). This change affects the output of the :mod:`pydoc`
1147+
module and the :func:`help` function. See :issue:`15582`.
1148+
11421149
Changes in the C API
11431150
--------------------
11441151

0 commit comments

Comments
 (0)