Python has its share of gotchas and quirks that can surprise both beginner and experienced software developers. This post highlights common Python pitfalls and provides tips for avoiding them.
Table of contents
Mutable Default Arguments Are a Bad IdeaNaN (Non-) ReflexivityLate Binding ClosuresReassigning Global VariablesProper Way to Define TuplesIndexing Byte Values Instead of Byte StringsIndexing with Negated VariableWhy Is It Returning None!?ConclusionSort: