Python idioms to help you write good code
summary
States concrete rules: module layout orders stdlib then third‑party then app imports, constants and exceptions up top, and use absolute imports for large projects; prefer classmethods for alternate constructors; avoid mutable defaults and class attributes by initializing in __init__; use pep8 and linters (pylint, pyflakes, flake8); prefer comprehensions are fastest for sequence loops and use join over repeated + for many strings; keep hot code inside try blocks because exceptions are expensive; refactor nested ifs with continue/return.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:37Coding conventions
- 2:45Python module layout
- 5:43Naming and imports
- 6:44Common coding patterns
- 11:16Code evolution
- 13:22Performance idioms
- 16:02Avoiding nested logic
- 17:14Mutability and data
- 20:14Language gotchas
- 22:18Tuples and commas
- 24:52Python development tools
- 25:53Q&A session








