Title: pydoc for __init__ with not docstring
Type: Stage:
Components: Documentation Versions: Python 3.6, Python 3.5
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Antony.Lee, docs@python, martin.panter
Priority: normal Keywords: 3.5regression

Created on 2016-01-08 23:30 by Antony.Lee, last changed 2016-01-09 02:06 by martin.panter.

Messages (2)
msg257784 - (view) Author: Antony Lee (Antony.Lee) * Date: 2016-01-08 23:30
For a class whose __init__ has no docstring, e.g.

    class C:
        def __init__(self, arg):

pydoc outputs

    <... cropped ...>
    class C(builtins.object)
     |  Methods defined here:
     |  __init__(self, arg)
     |      Initialize self.  See help(type(self)) for accurate signature.
    <... cropped ...>

The last part "See help(type(self)) for accurate signature." could arguably be cropped as the correct signature is already displayed (I see that this is the docstring of object.__init__, it's not clear to me why it needs this sentence.).
msg257791 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-01-09 02:06
I suspect this the same side effect of 3.5’s doc string inheritance that I mentioned in Issue 15582. The solution proposed was basically “write a custom doc string”, though I’m not sure that is always appropriate.
Date User Action Args
2016-01-09 02:06:10martin.pantersetkeywords: + 3.5regression
nosy: + martin.panter
messages: + msg257791

2016-01-08 23:30:07Antony.Leecreate