Python Oddities Explained
summary
Covers concrete behaviors: Python 3 only scope rules (for-loops leak loop variable, comprehensions do not), assignment versus mutation (assignments make locals; methods like list.extend mutate objects), and augmented assignment quirks where lists mutate with += but tuples/strings fall back to new objects. Demonstrates that += invokes __iadd__ then assignment, which can mutate a list inside a tuple then raise on the assignment. Uses short examples and surprising edge cases rather than abstract promises.
AI-written summary · about
chapters (6)
related talks
26mPython Oddities Explained
27mVariables and objects in Python: it's pointers all the way down
24mPython Peculiarities
01h 18mPython 103: Mmmm... Understanding Python's Memory Model, Mutability, and Methods
21mBecome a Better Pythonista by Abusing List Comprehensions and :=
01h 18mPython 103: Mmmm... Understanding Python's Memory Model, Mutability, and Methods
01h 07mWhat Does It All Really Mean
49mSeven Things Every Python Programmer Should Know
