関数
公式サイト:
使い方
参考:
Python3 のメソッドとスタティックメソッドの違いを検証してみた – Qiita
def / return – Python で関数を定義/呼び出し | note.nkmk.me
デフォルト値
参考:
引数にデフォルト値を設定する | Let’s プログラミング
可変長引数/キーワード引数
参考:
Python の可変長引数 (*args, **kwargs) の使い方 | note.nkmk.me
Keyword (Named) Arguments in Python: How to Use Them | Trey Hunner
Normal arguments vs. keyword arguments – Stack Overflow
why no spaces around ‘=’ in keyword argument or a default parameter value? – Stack Overflow
Unpacking dictionary with integer keys? – Stack Overflow
proper name for python * operator? – Stack Overflow
return 文
参考:
return 文 | Python 3.x ドキュメント [公式]
inspect.signature
参考:
Introspecting callables with the Signature object| Python 3.x documentation [Official]
Introspecting arguments from the constructor function __init__ in Python – Stack Overflow
仕組み
TL;DR
ミュータブルなコレクションを引数として渡した場合、関数やメソッドの内部で値の変更が可能である。
参考:
関数の引数は値渡し?参照渡し? | やさしい Python 入門