
Next Day Video
9 HN recommenders · recommended in 12 months, 2014–2022
48:51 · 1.1M views · Mar 21, 2013
Raymond Hettinger's PyCon 2013 talk on transforming code into idiomatic Python through a series of before-and-after refactorings. It shows how to use iterators, dictionaries, named tuples and other language features well.
HN treats it as a must-watch classic for writing Pythonic code, though somewhat dated for modern Python.
13 comments from Hacker News
Your mention of simple and clean code makes me think of the excellent talk "Transforming Code into Beautiful, Idiomatic Python". Although it relates to Python programming, if the ideas and principles (and thoughtfulness and pace) from it could be applied to much more written code, then (I think) we as an industry and all our users would be in a better place. [1] - this video
Must watch: this video I believe that the list comprehension will be faster than filter, but as always, any time you replace readable code with unreadable code for performance reasons, you damn well better time it.
I've never heard of Raymond Hettinger before but I'm currently watching one of his videos [1] and it's amazing. Thanks for sharing your list, I'll definitely look up some more of these people. [1] this video
Raymond Hettinger's talks are great. I know it's not a succint blog post, but they are out there are watching a video is very approachable. Maybe [LINK] (Dataclasses! We could cheekily say Python gets better at something Rust does - dataclasses makes Python better at records.) And [LINK] This talk (2013): this video Unfortunately this video is now a bit out of touch with modern Python. Another (2013) classic: [LINK] it is very well known, and it has the very memorable advice: what's a class that only has one method? That should be a function!
For an alternative perspective, allow me to present some classic talks from Raymond Hettinger. First, some generic tips on how to write Python code that's pleasant to work with: this video And then this one digs more specifically into how not to write Python like it's Java, starting at 12:40 (with talking about why leading up to that): [LINK]