Python Essential Reference (Second Edition)
Tags
Summary
Python Essential Reference (Second Edition) is the Chinese translation of David M. Beazley's Python Essential Reference, Second Edition. The original was published by New Riders in 2001, corresponding to Python 2.1, and is a reference manual for the Python language and standard library positioned around "lookup," running to more than four hundred pages, offering a compact and authoritative entry point for understanding the early Python 2.x system. In content, the book falls roughly into three parts. The first part addresses the language itself: starting from running programs in the interpreter, variables and expressions, conditional statements, and file input/output, it proceeds through such basic topics as strings, lists and tuples, dictionaries, loops, functions, classes, exceptions, and modules, helping readers quickly build an overall outline of Python; it then goes deeper into the type and object model, including the semantics of built-in types, references and copying, special methods and operator overloading, object comparison, and attribute access, offering more detailed explanations of language behavior than the official documentation. The second part is the main body of the book—the standard library reference, covering more than a hundred commonly used modules organized by category: string and text processing, mathematical operations, data management and persistence, operating system services, threads, network programming (sockets, HTTP, FTP, etc.), and internet data processing and encoding, with each module given brief examples and an API list. The third part discusses extending and embedding: how to write extension modules in C or C++, how to embed Python in a host program, and an overview of changes from Python 1.6 to 2.1. Note that the book's content stops at the Python 2.1 era, and many syntactic features and library interfaces have changed substantially in Python 3. Its value lies more in understanding Python's design philosophy and language skeleton than in directly looking up currently usable APIs; for readers maintaining legacy Python 2 code, it still has some reference value.
Editor's review
在 Python 还远未成为今日“通用胶水语言”的年代,Beazley 的这本参考书做了一件很有价值的事:它把散落在官方文档、邮件列表与源码注释里的语言细节,收拢成一本可以放在手边反复翻查的册子。全书结构清晰——“语言速览 → 对象与类型模型 → 标准库 → 扩展与嵌入”,三块内容各司其职,既能当入门读物顺读,也能当辞典按需检索。 它的长处有三点。其一,篇幅克制而信息密度高,作者坚持只讲“仍然有效”的模块与接口,主动剔除过时 API,读者不必在废弃内容里绕路。其二,语言章节不满足于语法罗列,而是着力解释引用、复制、特殊方法、属性访问这类容易一知半解的行为,正是这些细节决定了 Python 程序的可维护性。其三,网络编程、线程与 C 扩展部分写得扎实,至今仍能帮助读者理解 CPython 的运行时轮廓。 当然,它的时代烙印同样明显:内容对应 Python 2.1,书中的 print 语句、字符串模型与标准库接口都不适用于 Python 3。把它当作“历史版本的权威参考”或“语言设计思想的导读”,比当作日常 API 手册更合适。若你更想查阅现代 Python,建议改看同一作者后来修订的版本或官方文档;若你正在读老代码、需要理解这门语言的来路,这本小书仍然值得一读。
Who it's for
A good fit for
- 有编程基础、想系统了解 Python 2.x 语言与标准库全貌的开发者
- 需要维护或阅读早期 Python 2 遗留代码的工程人员
- 对 CPython 运行时、C 扩展与嵌入机制感兴趣的中高级程序员
- 喜欢以速查手册方式随手翻阅、按需检索的技术读者
Not a good fit for
- 零基础、想直接学习现代 Python 3 的初学者
- 希望查到现在可用 API 与第三方库用法的日常开发场景
- 偏好系统教程式讲授、需要大量练习题与项目案例的学习者
Reading tips
- 先通读第一章快速入门,建立基础语法印象,再按需跳读类型与对象、标准库参考等章节。
- 把本书当查询工具而非教材:遇到具体的模块或语言行为疑问时再翻查对应条目。
- 阅读时对照现版官方文档,注意 print 语句、字符串与迭代器接口等 Python 3 的差异。
- 遇到示例代码可在本地安装兼容的 Python 2 环境(如 2.7)验证,但不必记录已过时的 API。
Contents
- Chapter 1 A Quick Start to Python
- 1.1 Running Python
- 1.2 Variables and Expressions
- 1.3 Conditional Statements
- 1.4 File Input/Output
- 1.5 Strings
- 1.6 Lists and Tuples
- 1.7 Loops
- 1.8 Dictionaries
- 1.9 Functions
- 1.10 Classes
- 1.11 Exceptions
- 1.12 Modules
FAQ
这本书讲的是 Python 2 还是 Python 3?
原文对应的是 Python 2.1 时代,书中语法与标准库接口属于 Python 2.x 体系,与 Python 3 有明显差异,例如 print 是语句而非函数。
中文版是正式出版物吗?
目前可查到的中文材料是网络上的爱好者翻译稿(初译 Feather,修正补充 WeiZhong),未见权威书目记录显示有对应 ISBN 的正式中译版,购买或引用时请留意版本来源。
这本书适合当日常 API 手册查阅吗?
不太适合。书中收录的模块与接口多已过时,日常开发建议使用官方文档或本书后续修订版本,本书更适合理解语言设计与阅读旧代码。
它和《Python参考手册》是同一本书吗?
是同一原作(Python Essential Reference)的不同版本或译名。市面上常见的《Python参考手册》多基于第四版,内容对应 Python 2.6 且经扩充,与本第二版差异较大。
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.