Skip to content

Instantly share code, notes, and snippets.

@spider-man-tm
Created June 27, 2022 06:25
Show Gist options
  • Save spider-man-tm/97cec547b770e6445d81fd41ed98716f to your computer and use it in GitHub Desktop.
Save spider-man-tm/97cec547b770e6445d81fd41ed98716f to your computer and use it in GitHub Desktop.
Pythonのdocstringの正式なコーディングスタイル
def func(arg1, arg2):
"""概要
詳細説明
Args:
引数(arg1)の名前 (引数(arg1)の型): 引数(arg1)の説明
引数(arg2)の名前 (:obj:`引数(arg2)の型`, optional): 引数(arg2)の説明
Returns:
戻り値の型: 戻り値の説明
Raises:
例外の名前: 例外の説明
Yields:
戻り値の型: 戻り値についての説明
Examples:
関数の使い方
>>> func(5, 6)
11
Note:
注意事項や注釈など
"""
value = arg1 + arg2
return value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment