I am trying to decide what information to put in the docstring class and what to add to the __init__ docstring method. Until now, I talked about the class and how to work with it in the docstring class, while the material directly related to initialization (argument details, etc.) I put in __init__ docstring.
Today I started wondering if this is the right way to do this, so I looked at a couple of built-in modules and I see that the __init__ method almost never has a docstring. According to PEP8, "Docstrings are not needed for non-public methods", but not __init__ public?
In the same vein, what about other special methods like __getitem__ , __getattr__ or __new__ , should they have docstrings? Or should I just mention the implications they have in the docstring class?
python docstring
Lauritz V. Thaulow
source share