[Python-checkins] cpython (merge 3.5 -> default): Issue #15582: Add a whatsnew entry for inspect.getdoc() changes in 3.5.

berker.peksag python-checkins at python.org
Thu Jul 30 17:06:56 CEST 2015


https://hg.python.org/cpython/rev/e0f4a5f09bfa
changeset:   97144:e0f4a5f09bfa
parent:      97141:89d34aea8d7e
parent:      97143:4476b578b8fd
user:        Berker Peksag <berker.peksag at gmail.com>
date:        Thu Jul 30 18:06:30 2015 +0300
summary:
  Issue #15582: Add a whatsnew entry for inspect.getdoc() changes in 3.5.

Patch by Martin Panter.

files:
  Doc/library/inspect.rst |  3 +++
  Doc/whatsnew/3.5.rst    |  7 +++++++
  2 files changed, 10 insertions(+), 0 deletions(-)


diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -404,6 +404,9 @@
    a class, a method, a property or a descriptor, retrieve the documentation
    string from the inheritance hierarchy.
 
+   .. versionchanged:: 3.5
+      Documentation strings are now inherited if not overridden.
+
 
 .. function:: getcomments(object)
 
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst
--- a/Doc/whatsnew/3.5.rst
+++ b/Doc/whatsnew/3.5.rst
@@ -1139,6 +1139,13 @@
   ``True`` when finding the empty string and the indexes are completely out of
   range.  See :issue:`24284`.
 
+* The :func:`inspect.getdoc` function now returns documentation strings
+  inherited from base classes.  Documentation strings no longer need to be
+  duplicated if the inherited documentation is appropriate.  To suppress an
+  inherited string, an empty string must be specified (or the documentation
+  may be filled in).  This change affects the output of the :mod:`pydoc`
+  module and the :func:`help` function.  See :issue:`15582`.
+
 Changes in the C API
 --------------------
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list