Ignite Talk - 2019 Python Gotchas, Tips, and Tricks
summary
Three concrete gotchas with concrete fixes: chained comparisons act as range checks so a b c parses as (a b) and (b c) not left association; and/or return operands so x and y yields x when x is falsy and x otherwise, causing surprising assignments; and mutable default arguments persist where a default list accumulates across calls — fix by using None (or another immutable) and creating the container inside the function.
AI-written summary · about
related talks
27mVariables and objects in Python: it's pointers all the way down
30mArgs: Amazing or Approaching?
27mPython Oddities Explained
49mSeven Things Every Python Programmer Should Know
31mDon't Do This
21mBecome a Better Pythonista by Abusing List Comprehensions and :=
26mPython Oddities Explained
25mPython as a Hackable Language for Interactive Data Science
