Python 3 Deep Dive
Notes from the Python 3 Deep Dive series (Udemy). Python is a “batteries-included” language — a large standard library and a culture of readability.
The Zen of Python
import thisBeautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
(Tim Peters — PEP 20.)
PEPs
Python Enhancement Proposals document proposed and accepted language features. PEP 8 (style) and PEP 20 (Zen) are the ones you’ll cite most.
Mental Model Highlights
- Everything is an object — including functions and classes; names are references bound to objects.
- Mutable vs immutable —
list/dict/setmutable;int/str/tupleimmutable. Drives copying, default-arg, and hashing gotchas. - Truthiness — empty containers,
0,None,""are falsy. isvs==— identity vs equality; useisonly forNone/singletons.
Modern Tooling
uv venv && source .venv/bin/activate # fast venv + installs (uv)
ruff check . && ruff format . # lint + format
python -m pytest # tests