Transforming Code into Beautiful, Idiomatic Python
9 人推荐 · 跨 9 个月 · 2014–2022

中文导读
Python 核心开发者 Raymond Hettinger 在 PyCon 2013 上的经典演讲。通过一系列重构前后的代码对比,演示如何妙用迭代器、字典、namedtuple 等原生特性写出优美、地道的 Python 代码。
为什么 HN 推它
被 HN 奉为掌握 Pythonic 编码风格的必看神作,尽管部分现代特性略显年代感,但重构思维与理念永不过时。
「那场名为「把代码改造成优美、地道的 Python」的绝佳演讲。」HN 网友原话:the excellent talk "Transforming Code into Beautiful, Idiomatic Python".
英文原摘要(HackerTube / Claude 整理)
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.
HN 上的提及
Halfway through and this one seems great so far
Great talk on avoiding some of the common pitfalls new python developers step in.
I came to the comments to post the same thing[1]
Topics include: 'looping' with iterators to avoid creating new lists, dictionaries, named tuples and more