Message 243248 - Python tracker

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.

Content
getdoc-news.patch suggests some wording to add to What’s New, and also adds a “Changed in version 3.5” note to inspect.getdoc().

BTW I also noticed that the class doc strings are not inherited from object.__doc__, although method doc strings _are_ inherited from object(), such as object.__init__.__doc__. The current documentation suggests that the class doc string “The most base type” should also be inherited.

$ cat module.py
class SomeClass:
    '''CLASS DOCSTRING'''
    def __init__(self):
        '''METHOD DOCSTRING'''
$ ./python -m pydoc module.SomeClass  # Doc strings intact
[. . .]
module.SomeClass = class SomeClass(builtins.object)
 |  CLASS DOCSTRING
 |  
 |  Methods defined here:
 |  
 |  __init__(self)
 |      METHOD DOCSTRING
 |  [. . .]
$ ./python -OOm pydoc module.SomeClass  # Method inherited, class stripped
[. . .]
module.SomeClass = class SomeClass(builtins.object)
 |  Methods defined here:
 |  
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |  [. . .]

I also wonder how well this feature would work when someone tries to override a base method by using a mix-in type class.