Message243248
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. |
|
Date |
User |
Action |
Args |
2015-05-15 06:30:38 | martin.panter | set | recipients:
+ martin.panter, ncoghlan, eric.araujo, Claudiu.Popa, ethan.furman, python-dev, eric.snow, serhiy.storchaka, yselivanov |
2015-05-15 06:30:38 | martin.panter | set | messageid: <1431671438.28.0.504655836221.issue15582@psf.upfronthosting.co.za> |
2015-05-15 06:30:38 | martin.panter | link | issue15582 messages |
2015-05-15 06:30:38 | martin.panter | create | |
|