Learning Python (5th Edition)

Mark LutzChina Machine Press2018

Rating 4.0
Chapters
1
Series
Learning Python (5th Edition)
ISBN
9787111603665

Tags

Computing Software Tutorials CodingException HandlingProgramming DesignProgramming LanguageObject-Oriented ProgrammingStudy HandbookField CasesSystematic GuideLanguage Primer

Summary

Learning Python is the Chinese translation of the fifth edition of Mark Lutz's classic Python tutorial Learning Python, translated by Qin He and Lin Ming and published by China Machine Press in two volumes. The fifth edition centers on Python 3.x while also covering the differences in Python 2.7, spanning from language basics to advanced tools. The book is divided into eight parts by topic: it first covers Python's place, how the interpreter works, and ways to run programs such as the interactive command line, files, and IDLE; then systematically explains built-in object types, including numbers, strings, lists, dictionaries, tuples, and files; next it discusses statements and syntax, covering assignment, expressions, if tests, while and for loops, iteration and comprehensions, and how to use Python documentation; this is followed by functions and generators, scope, argument passing, advanced function topics, and performance timing; then the organization of modules and packages; Part Six turns to classes and object-oriented programming, covering class coding, operator overloading, and class design; Part Seven covers the exception handling model, exception objects, and exception design; and Part Eight offers optional advanced material, including Unicode and byte strings, attribute management tools such as property and descriptors, decorators, and metaclasses. Each chapter includes a "Chapter Summary," "Chapter Quiz," and quiz answers, each part includes exercises, and the book features numerous annotated examples and diagrams, emphasizing genuine understanding of Python's semantics and carrying on the author's years of teaching Python training courses.

Editor's review

很多 Python 书告诉你“怎么写”,这本书解释的是“为什么这样写”。Mark Lutz 是活跃了三十余年的 Python 培训讲师,书稿直接脱胎于他的课堂材料,因此节奏很稳、铺垫很足:一个概念往往先给出运行结果,再解释背后的对象模型和名字绑定规则。第五版以 Python 3.x 为主线,同时点明 Python 2.7 的差异,适合中文读者已几乎不再使用 Python 2 的当下仍然按揭其“老派写法”的历史包袱。全书真正值钱的是那些容易被跳过的地方:动态类型如何被解释器一步步执行,迭代协议与推导之间是什么关系,类树上的名称搜索如何决定方法调用,属性描述符和元类究竟解决了什么问题,“名字”与“对象”的分离如何影响赋值操作。每章末尾的“本章习题”和逐题解答,让这本书可以直接当作自学教程用,而不是只能当参考手册从头翻到尾。当然,1500 余页的篇幅意味着它并不轻快,行文也偶有重复,但这正是它“讲透”所付出的成本。

Who it's for

A good fit for

Not a good fit for

Reading tips

  1. 先读第三部分“你应如何运行程序”,把交互式命令行、脚本和 IDLE 三种方式用熟再进正文
  2. 第一部分至第五部分按顺序精读并动手敲例子,第六部分之后可作为第二遍的进阶目标
  3. 每章务必先做完“本章习题”再看解答,答错的题要在代码里复现一次
  4. 书中示例基于 Python 3.3 前后版本,练习时用较新的 Python 3 运行,遇到差异以官方文档为准

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. O'Reilly Animal Series (Chinese Translation)

FAQ

这本书的第五版对应哪个 Python 版本? 原书第5版以 Python 3.3 与 Python 2.7 为主要参照编写,重心明显偏向 Python 3.x,同时标注了 2.x 与 3.x 的差异;用当前 3.x 版本学习基本无碍,个别语法细节建议以官方文档核对。
零基础可以直接读这本吗? 作者在前言中说明,本书可作第一本 Python 读物,但它更多讲 Python 本身,而非编程入门常识。完全没接触过编程的读者,先读一本通用的编程导论再回来会更顺。
上册和下册各自讲什么? 上册为前言及前五部分,从 Python 的定位、运行方式讲到内置对象类型、语句语法、函数与生成器和模块包;下册为第六至第八部分,讲类与面向对象编程、异常处理,以及 Unicode、属性管理、装饰器、元类等进阶话题。
和《流畅的Python》《Python编程:从入门到实践》怎么选? 本书侧重从语言底层把 Python 的对象模型、作用域、类与异常讲到能自学明白;《从入门到实践》偏项目驱动,上手更快;《流畅的Python》更偏 Pythonic 惯用法与进阶实践。入门求快选前者之外的后者,求透则本书。

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.

About the author

Mark Lutz Author

Mark Lutz is a technical author long engaged in Python teaching and writing. Public information about him is limited, and details such as his nationality and dates of birth and death remain unclear. The Chinese book database includes five of his works, with the representative titles being the fifth and fourth editions of Learning Python. These books cover Python's basic syntax, core mechanisms, and practical applications, and fall under computer science, software learning, and programming design. His writing is known for being substantial, rich in examples, and detailed in explanation, helping readers move gradually from beginner level to a deeper understanding of the language's features. As a result, he is widely recognized among Python learners, and his books are often used as reference works for systematic study of the language.