HN 精选

Transforming Code into Beautiful, Idiomatic Python

Next Day Video
9 人推荐 · 跨 9 个月 · 2014–2022
脚本与动态语言(Python、Ruby 等)软件工程实践、开源与职业发展
Transforming Code into Beautiful, Idiomatic Python

中文导读

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 上的提及

rec kriro · 2014-03 · HN 原文
Halfway through and this one seems great so far
rec msvalkon · 2014-07 · HN 原文
Great talk on avoiding some of the common pitfalls new python developers step in.
reference eddyg · 2014-07 · HN 原文
I came to the comments to post the same thing[1]
rec shackenberg · 2014-11 · HN 原文
Topics include: 'looping' with iterators to avoid creating new lists, dictionaries, named tuples and more
reference smt88 · 2016-06 · HN 原文

相关视频