Was going through a Python tutorial, but it seems kinda dated. Wanted to know if people regularly use docstrings in the workforce. Or are they somewhat irrelevant because you can convey most of that info via comments and context? Do jobs make you use them?
Yes they are sometimes used, as is doctest, but Python’s built in help system isn’t as good as it could be, so the docstrings aren’t that useful. Most annoyingly, for built in library classes, help(whatever) spews machine generated prototypes at you before you get any actual documentation.
I generally like to write some kind of explanatory text along with any nontrivial function that I write, but I’m not very consistent about doing this as a doctring vs as a code comment. I do use type annotations heavily nowadays.