Message243248
| Author |
martin.panter |
| Recipients |
Claudiu.Popa, eric.araujo, eric.snow, ethan.furman, martin.panter, ncoghlan, python-dev, serhiy.storchaka, yselivanov |
| Date |
2015年05月15日.06:30:37 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1431671438.28.0.504655836221.issue15582@psf.upfronthosting.co.za> |
| In-reply-to |
| 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. |
|