|
|
|
|
|
by julienpalard
1590 days ago
|
|
This is typically the kind of idea that I don't understand: docstrings are here so the developer can state what *needs* to be stated here (the *not obvious*) the why, the how, the known limits... Taking a comment as an example, compare: if is_even(x): # if x is even
and: except UnicodeError as err: # Can happen on malformed IDNA.
One is not usefull (but can be derived automatically), the other one IS usefull to understand the code, but *can't be derived automatically* (without a deep understanding of the used libraries behind the various calls in the try statement). |
|
Pretty much all doc gen tools can generate is SBO comments so they are rarely useful.
Often they are essentially wrong, e.g. a getter with the autogenerated comment "gets the X from Y" without checking the method code to see if actually, it has some horrible side effects that you would not expect to be there. The comment hides the truth about the method.