Learning Python (4th Edition) cover

Learning Python (4th Edition)

Rating 4.0
Chapters
40
Series
O'Reilly Best-Selling Books Series
ISBN
9787111326533

Tags

Summary

Learning Python (4th Edition) is the Chinese translation of the fourth edition of Learning Python by Python instructor Mark Lutz, translated by Li Jun, Liu Hongwei, and others, published by China Machine Press in 2011, running 889 pages and 39 chapters. Building on the original, the book uses Python 3.0 as its primary version while accommodating the habits of Python 2.x readers. The book advances layer by layer through language features in nine parts: three chapters first clarify Python's place, how programs run, and how to run programs; then it systematically unfolds built-in object types, including numbers, strings, lists, dictionaries, tuples, and files; next come statements and syntax, covering assignment, if, while/for, iterators and comprehensions, and documentation tools; then functions (scope, arguments, advanced topics), modules and packages, classes and object-oriented programming (operator overloading, class design), exception handling, and development tools; finally, advanced topics new to the fourth edition: Unicode and byte strings, attribute management, decorators, and metaclasses, with appendices offering installation and configuration advice and solutions to the exercises in each part. The book is positioned to "teach readers the Python language itself" rather than a specific application area. Each chapter is relatively self-contained, with exercises at the beginning or end and numerous annotated examples, suitable for self-learners who want to build a systematic foundation in Python and understand the object model and syntax details. The examples are mostly basic syntax demonstrations and do not involve large project practice.

Editor's review

如果要为「系统地学一遍 Python 语言」挑一本教材,Mark Lutz 的这本《Python学习手册》是绕不开的选项。它的特点是把语言拆成对象、语句、函数、模块、类、异常这几个层次来讲解,读者可以按顺序学下去,看到 Python 的解释器是怎样一步步执行的,而不是只背几条语法。 和常见的速成书相比,它内容更多、更细,同一件事往往会给几种写法,并说明各自的适用场景,比如列表推导式和 for 循环怎么选、装饰器怎么组织代码。每部分后面都有练习题,附录给出解答,适合边读边动手。 需要提醒的是:中文第四版基于 Python 3.0,而今天通用的是 3.10 以上版本;书里的一些语法细节、库工具已经过时,阅读时请在手边的解释器上核对一遍。本书也一直被读者提到翻译质量方面的问题,遇到读不通的句子,建议对照英文原版。总体而言,这是一本「慢功夫」式的基础书,适合愿意投入时间打牢底子的读者。

Who it's for

A good fit for

  • 希望系统掌握 Python 语法、而不只是会写脚本的自学者
  • 有其他语言基础、想弄清 Python 对象模型与运行机制的开发者
  • 在校学生或培训学员,需要一本与课程配套的完整教材
  • 准备面试或考试、需要系统梳理 Python 语言细节的读者

Not a good fit for

  • 只想一两周速成、马上做出项目的人,本书篇幅与节奏偏慢
  • 主要想做数据分析、Web 开发、爬虫等应用的人,本书几乎不讲这些框架
  • 零基础且对编程完全陌生、需要大量图示引导的读者,本书文字密度较高

Reading tips

  1. 按第一到第七部分的顺序通读,每读完一部分就完成该部分练习,并对照附录B核对。
  2. 边读边在 Python 3 解释器里验证示例,遇到与当前版本不符的语法,以官方文档为准。
  3. 翻译表述拗口的地方先对照英文原版章节,再去查官方教程和语言参考。
  4. 第八部分(Unicode、属性、装饰器、元类)可先略读,等有了项目经验再回看。

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

FAQ

这本书讲的是 Python 2 还是 Python 3?
中文第4版主要按 Python 3.0 讲解,同时兼顾 2.x 的差异;英文第5版则以 Python 2.7 和 3.3 为基础。如今实际使用的是 3.10 以上版本,书中的语法示例需在解释器里核对,个别工具与写法已经过时。
零基础可以直接读这本书吗?
可以,但要有心理准备。本书从「Python 能做什么」讲起,不要求编程背景;不过篇幅长、文字密,零基础读者最好配合视频课或小项目,边学边练,否则容易读不下去。
书里的练习题有答案吗?
有。各章思考题在章节内给出答案,每部分末尾的练习解答集中在附录B,读者可以先自己动手,再核对解答。
第四版和第五版该买哪个?
第五版内容更全,基于 Python 2.7 和 3.3,分上下册约 1467 页;第四版篇幅较短,839 页左右,适合想抓紧过一遍语言核心的读者。两者都会与当前 Python 版本有差距,选择哪版都可,但不要指望它覆盖 Python 3.10 以后的新特性。

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