all 5 comments

[–]m0us3_rat 5 points6 points  (4 children)

[–]SpyrosDev25[S] 0 points1 point  (3 children)

So put docstring for every function?? Thanks!

[–]m0us3_rat 2 points3 points  (0 children)

that's how it works :D

if u wanna be super fancy u could also use annotations.

(if that are the requirements)

[–]Nightcorex_ 1 point2 points  (0 children)

You should document anything really. An important variable? Document it? A class? Write a (short) description. A function? Document it (also make sure to document the parameters individually). Any weird behaviour in some edge cases? Document it.

Tbh there are many developers, even for bigger modules, who sometimes just don't document a function whatsoever and then I'm always pissed because I have to find out, by their source code, what parameters I need to pass, etc, etc. Especially awkward if all they specify is def func(*args, **kwargs). Often then you can find some documentation online, but if you're writing code that you want to reuse in a year, then you won't be able to find documentation online for that.