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.

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

Created on 2016-01-08 23:30 by Antony.Lee, last changed 2022-04-11 14:58 by admin.

Messages (3)
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):
            pass

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.
msg415714 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-03-21 21:53
Is the "See help(type(self)) for accurate signature." part of object.__init__ docstring useful? May we can just remove it?
History
Date User Action Args
2022-04-11 14:58:25adminsetgithub: 70240
2022-03-21 21:53:20iritkatrielsetnosy: + iritkatriel
messages: + msg415714
2016-01-09 02:06:10martin.pantersetkeywords: + 3.5regression
nosy: + martin.panter
messages: + msg257791

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