Learning Python (5th Edition, Chinese Translation) cover

Learning Python (5th Edition, Chinese Translation)

Rating 4.0
Chapters
40
Series
O'Reilly Animal Series (Chinese Translation)
ISBN
9787111603665

Tags

Summary

Learning Python (5th Edition, Chinese Translation) is the Chinese translation of the 5th edition of Mark Lutz's Learning Python, published as a two-volume set in one slipcase, translated by Qin He and Lin Ming, and published by China Machine Press in 2018. The book grew out of the author's many years of teaching Python training courses and is a systematic Python language tutorial suited to both self-study and classroom use. Its main text proceeds in the order "Getting Started—Types and Operations—Statements and Syntax—Functions and Generators—Modules and Packages—Classes and Object-Oriented Programming—Exceptions and Tools—Advanced Topics," with each chapter concentrating on a single subject and accompanied by end-of-chapter quizzes, programming exercises, and solutions, while also interspersing numerous annotated example code snippets and diagrams. The 5th edition uses Python 2.7 and 3.3 as its primary reference versions and shifts its emphasis further toward Python 3 than the previous edition; the syntax and language mechanisms discussed in the book remain largely applicable in newer Python versions. The book not only explains core topics such as built-in object types, the statement model, function scope and arguments, modules and packages, classes and operator overloading, and exception handling, but also discusses advanced language features in depth, including Unicode and byte strings, managed attributes, decorators and metaclasses, and descriptors. It can therefore serve both as an introductory text starting from zero and as a desk reference for checking language details. The book is enormous in length and meticulous in explanation; readers need to invest considerable time and to work through hands-on exercises to absorb it.

Editor's review

这是一本“厚重型”的 Python 教程:1500 页左右的篇幅,把语言从对象类型、语句、函数、模块、类、异常一路讲到装饰器、描述符和元类,几乎覆盖了纯语言层面的全部主要机制。它的优点不在于“快”,而在于“透”——作者是长期做 Python 培训的讲师,习惯把每个概念的边界条件、常见误区和背后原因都讲清楚,配以带注释的代码、章后测验和练习解答,非常适合希望把基础打扎实的读者。第 5 版以 Python 2.7 和 3.3 为参照,虽然如今的 Python 已经迭代很多版本,但书里讲的语言模型、作用域规则、对象模型、异常与装饰器机制并没有过时,仍是理解 Python 的关键。需要提醒的是:全书偏细偏长,逐字通读容易半途而废,更适合当作“主线通读 + 长期查阅”的两用书;同时它不涉及 Web 框架、数据分析、爬虫等应用主题,想直接做项目的人需另配实战类图书。

Who it's for

A good fit for

  • 已有其他语言基础、想系统吃透 Python 语言机制的开发者
  • 愿意投入较多时间、希望打牢语法与对象模型基础的自学者
  • 计算机专业学生,作为编程语言课程的配套阅读与练习来源
  • 需要一本可长期查阅的 Python 语法与语言特性参考书的从业者

Not a good fit for

  • 希望两三天速成、马上用 Python 做项目或求职的零基础读者
  • 只想学数据分析、爬虫、Web 开发等应用方向、不在意语言细节的人
  • 不适应长篇教材式行文、偏好案例驱动短篇教程的读者

Reading tips

  1. 先通读第一至第三部分,把对象类型与语句模型吃透,其余部分按需查阅或精读。
  2. 每章后的测验与练习务必动手在解释器里敲一遍,切忌只看不写。
  3. 阅读时用 Python 3 实操;遇到书中 Python 2 的差异说明可先略过,回头再对照理解。
  4. 把第四至第八部分当作案头参考,遇到作用域、装饰器、元类等疑点再回查对应章节。

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. Volume 1 Preface
  2. Part I Getting Started
  3. Chapter 1 A Question-and-Answer Session
  4. Chapter 2 How Python Runs Programs
  5. Chapter 3 How You Run Programs
  6. Part II Types and Operations
  7. Chapter 4 Introducing Python Object Types
  8. Chapter 5 Numeric Types
  9. Chapter 6 The Dynamic Typing Interlude
  10. Chapter 7 String Fundamentals
  11. Chapter 8 Lists and Dictionaries
  12. Chapter 9 Tuples, Files, and Everything Else
  13. Part III Statements and Syntax
  14. Chapter 10 Introducing Python Statements
  15. Chapter 11 Assignments, Expressions, and Prints
  16. Chapter 12 if Tests and Syntax Rules
  17. Chapter 13 while and for Loops
  18. Chapter 14 Iterations and Comprehensions
  19. Chapter 15 The Documentation Interlude
  20. Part IV Functions and Generators
  21. Chapter 16 Function Basics
  22. Chapter 17 Scopes
  23. Chapter 18 Arguments
  24. Chapter 19 Advanced Function Topics
  25. Chapter 20 Comprehensions and Generations
  26. Chapter 21 The Benchmarking Interlude
  27. Volume 2 Part V Modules and Packages
  28. Chapter 22 Modules: The Big Picture
  29. Chapter 23 Module Coding Basics
  30. Chapter 24 Module Packages
  31. Chapter 25 Advanced Module Topics
  32. Part VI Classes and Object-Oriented Programming
  33. Chapter 26 OOP: The Big Picture
  34. Chapter 27 Class Coding Basics
  35. Chapter 28 A More Realistic Example
  36. Chapter 29 Class Coding Details
  37. Chapter 30 Operator Overloading
  38. Chapter 31 Designing with Classes
  39. Chapter 32 Advanced Class Topics
  40. Part VII Exceptions and Tools

FAQ

这本书适合零基础学 Python 吗?
可以,但需要耐心。书中从“为什么用 Python”“如何运行程序”讲起,默认读者不一定有编程经验;不过篇幅很长、讲解偏细,零基础读者建议先配合一门短课程或实战教程入门,再用本书补齐语法与语言机制。
第 5 版讲的是 Python 2 还是 Python 3?
第 5 版以 Python 2.7 和 3.3 为主要参照版本,重心较前一版更多向 Python 3 倾斜,同时会标注两者的差异。今天学习时请用 Python 3 实操,书中涉及 Python 2 特有的写法可以略读或跳过。
这本书和《Python 编程》《流畅的 Python》有什么区别?
《Python 学习手册》是同一作者 Mark Lutz 的入门级系统教程,重在讲清语言全貌与语法机制;《流畅的 Python》面向已有基础者,偏重 Pythonic 写法与高级特性;《Python 编程》则是另一本覆盖应用主题的教程,主题范围更广,但语言讲解深度不及本书。
内容这么厚,一定要从头读到尾吗?
不必。建议按“第一部分至第三部分通读、后面按需精读或查阅”的方式使用,把它当作主线教材加长期参考书,比强行逐页通读更容易坚持,也更实用。
书中的示例代码还能在现在的 Python 上跑吗?
书中大部分核心语法、对象模型、函数与类的示例在较新的 Python 3 版本上仍可运行;涉及打印语句、字符串与 Unicode、部分标准库行为差异的示例可能需要按 Python 3 稍作调整,读者应具备基本的版本差异意识。

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.

More by the same author

Top rated in the same category