Transforming Code into Beautiful, Idiomatic Python
Next Day VideoYouTube ↗
Caption notes
In this Python talk, Raymond Hettinger uses iteration, sorting and resource management to show how code can express intent directly. He uses enumerate when both position and value matter, and a sort key to name the property that determines the ordering. He also uses a loop’s else to distinguish normal completion from an early break, and context managers to group repeated setup and cleanup. The talk spans Python 2 and Python 3. This guide focuses on what the examples say about reading and maintaining code. Slides, timings and version-specific behavior were not independently verified.
Archived captions (transcription method unspecified) ↗Original passages · 2
says what you want it's more declarativeit factored out the setup logic and tear down logic