In C# and through Visual Studio, it is possible to comment your functions, so you can tell whoever is using your class what the input arguments should be, what it is supposed to return, etc. Is there anything remotely similar in python?
In Python you use docstrings like this:
def foo():
""" Here is the docstring """
Basically you need to have a triple quoted string be on the first line of a function, class, or module to be considered a docstring.
Note: Actually I you don't have to use a triple quoted string but that is the convention. Any liter string will do but it is best to stick with convention and use the triple quoted string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With