'Python docstring convention for private properties
Is it necessary to write a docstring for private properties? https://peps.python.org/pep-0008/ says that "Docstrings are not necessary for non-public methods, but you should have a comment that describes what the method does. This comment should appear after the def line." Does this also include private properties?
Solution 1:[1]
Generally in Python, you should strive for your documentation to be cohesive. Match the style with the rest of your project. You could opt to not document the property at all, use comments only, or write documentation like you did elsewhere.
I personally would suggest the last one and remembering to maintain cohesion.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Markus Hirsimäki |
