Python Mutable Defaults Are The Source of All Evil
This is a nasty Python gotcha; worth knowing about:
Do not use mutable default arguments in Python, unless you have a REALLY good reason to do so. Why? Because it can lead to all sorts of nasty and horrible bugs, give you headaches and waste everyone’s time. Instead, default to None and assign the mutable value inside the function.
(tags: python gotchas coding errors bugs mutability programming)