Mutable Default Arguments in Python
Why Python evaluates default arguments once, how mutable defaults retain state between calls, and how the None sentinel pattern avoids the problem.
3 articles
Why Python evaluates default arguments once, how mutable defaults retain state between calls, and how the None sentinel pattern avoids the problem.
An introduction to CPython's object representation through PyObject, PyVarObject, reference counting, type pointers, and variable-sized objects.
A comparison of recursive, iterative, paired-multiplication, and prime-decomposition approaches to computing large factorials in Python and Java.