-
-
Notifications
You must be signed in to change notification settings - Fork 146
__init__ docstring appears in class documentation #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll disagree. While How would you justify the contrary? |
Ok, thank you, that makes sense. So a meaningful way to use the
It would be good know that it behaves this way. I am using How about adding this information to the documentation? |
The class docstring describes the class. The methods docstrings describe the methods. Whether you place the explicit parameters documentation in the class docstring or in the # IPython prompt
>>> class C:
... """class docstring"""
... def __init__(self, a):
... """init docstring"""
>>> C??
Init signature: C(a)
Docstring: class docstring
Init docstring: init docstring
File: ~/bin/ipython
Type: type
Subclasses: How else would you use |
FWIW, this changeset makes sense. One always initialized the relevant object with |
Thank you for digging in my code and encouraging me to remove the Everything you said makes a lot of sense. The only problem is, if all you know is that you should document every function, then you also document the |
I guess I'd have to see the line first. If you think you can improve the docs, sure, go for it. 👍 |
Ok, challenge taken. Since it is such a small change I do not make a pull request. In line 106 of pdoc/documentation.md Lines 104 to 107 in 39a1e73
I suggest to insert
Sorry, it is more than a line... maybe "A valid approach ..." is too much and can be removed. |
Ok, I made a pull request #261 |
Expected Behavior
Since by default pdoc3 ignores
__init__(self)
functions of classes, a docstring of an__init__(self)
function should not appear anywhere in the generated documentation.Actual Behavior
The whole docstring of the
__init__(self)
function is appended (nicely formatted) to the documentation of the class.Steps to Reproduce
Additional info
The text was updated successfully, but these errors were encountered: