Last active
August 9, 2021 10:44
-
-
Save Rustam-Z/5d9e712dd63013468c103f2eab9f3862 to your computer and use it in GitHub Desktop.
How to write docstrning of Python function.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Docstring - Google style | |
def function(arg_1, arg_2=42, some_function): | |
"""Descriptioin of what this function does. | |
Args: | |
arg_1 (str): Description of arg_1. | |
(The string to search). | |
arg_2 (int, optional): Write optional when | |
argument has default value. | |
some_function (callable): The function we want a tooltip for. | |
Returns: | |
bool: Optional description of the return value. | |
Extra lines not indedted. | |
Raises: | |
ValueError: Include any type of error that the function raises. | |
Notes: | |
See https://......com for more usage. | |
import inspect | |
doc = inspect.getdoc(function) | |
""" | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment