Expert Python Programming, Second Edition cover

Expert Python Programming, Second Edition

Rating 3.6
Word count
369K words
Chapters
14
ISBN
9787115460158

Tags

Summary

Expert Python Programming, Second Edition is the Simplified Chinese translation of the second edition of Packt's Expert Python Programming, co-authored by Michał Jaworski and Tarek Ziadé, translated by Zhang Liang and Axin, and published by Posts & Telecom Press in 2017. Written against Python 3.5, the book runs to 14 chapters and roughly 370,000 characters, and is aimed at readers who can already write Python but want to produce more professional code. It begins by surveying the current state of the Python community, the main differences between Python 3 and Python 2 and the tools for bridging them, and productivity tools such as virtual environments, containerized development environments, and the IPython interactive debugger. It then moves to the language itself, covering advanced syntax—iterators and yield, decorators, context managers, subclassing built-in types, method resolution order (MRO), descriptors, property, and metaclasses—and discusses PEP 8 and naming practices in systematic detail. The engineering-practice section covers writing and publishing packages, code deployment, writing extensions in C/C++ and Cython, version control and continuous integration, documentation style, test-driven development and mocking, profiling techniques and common acceleration methods, and closes with a chapter on concurrency (threads, processes, and async/await asynchronous programming) and common design patterns. Overall, the book combines advanced language techniques with software engineering process, striving to make the reader's projects readable, maintainable, and deployable.

Editor's review

市面上讲 Python 语法的书很多,讲「一个 Python 项目该怎么活下来」的书却不多,这本正是后者。它不满足于教你写出一行能跑的代码,而是把包的打包发布、代码部署、文档撰写、持续集成、测试覆盖、性能剖析到并发模型串成一条完整链路,读完你会明白为什么有些项目越写越乱、有些项目却可以持续迭代。 比较难得的是它对语言细节的处理有深度又不炫技:生成器、装饰器、上下文管理器、描述符、元类这些常被当成「面试八股」的内容,都被放回了真实的开发场景里讲,并配有可直接运行的示例。关于命名规范和 PEP 8 的那一章尤其值得反复翻,很多代码质量问题其实从这里就埋下了。 需要提醒的是,本书基于 Python 3.5 撰写,涉及的工具链(如部分打包、部署与测试工具)在今天已经有了更新版本,读者需要结合当前生态自行替换。但书中讨论的工程判断和取舍原则并不过时,配合官方文档一起读,仍是一本扎实的进阶读物。

Who it's for

A good fit for

  • 已掌握 Python 基础语法、写过几百行以上代码,想系统提升工程能力的开发者
  • 从事 Web 后端或数据处理,需独立负责项目打包、部署与维护的工程师
  • 希望理解装饰器、元类、描述符等进阶机制背后原理的自学者
  • 计算机相关专业高年级学生或研究生,作为课程之外的实践补充读物

Not a good fit for

  • 完全没有编程经验的零基础读者,书中不讲解变量、循环等入门内容
  • 只想快速学习爬虫、数据分析等具体应用、不关心工程规范的读者
  • 追求完全贴合最新 Python 版本与工具链的读者,需注意书中部分内容已过时

Reading tips

  1. 第1至3章是语言进阶的地基,建议先精读并动手改写示例代码,再进入工程章节
  2. 第5至10章可结合自己手头的一个真实项目边读边练,把打包、文档和测试真正落地
  3. 第11至13章涉及性能与并发,建议配合 cProfile 等工具实测,避免只停留在概念层面
  4. 书中工具版本较老,遇到与当前环境不符处,及时对照官方文档与新版工具补正

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. Chapter 1 The Current State of Python
  2. Chapter 2 Syntax Best Practices—Below the Class Level
  3. Chapter 3 Syntax Best Practices—Above the Class Level
  4. Chapter 4 Choosing Good Names
  5. Chapter 5 Writing a Package
  6. Chapter 6 Deploying Code
  7. Chapter 7 Developing Python Extensions with Other Languages
  8. Chapter 8 Managing Code
  9. Chapter 9 Documenting Your Project
  10. Chapter 10 Test-Driven Development
  11. Chapter 11 Optimization—General Principles and Profiling Techniques
  12. Chapter 12 Optimization—Some Powerful Techniques
  13. Chapter 13 Concurrency
  14. Chapter 14 Useful Design Patterns

FAQ

这本书适合零基础学 Python 的人吗?
不适合。本书定位是进阶读物,默认读者已熟悉基本语法、数据结构与面向对象概念,直接从 Python 社区现状、进阶语法和工程实践讲起,没有入门内容。
第2版和第1版有什么区别?
第1版由 Tarek Ziadé 独著、2010 年出版,基于 Python 2 时代;第2版由 Michał Jaworski 与 Tarek Ziadé 合著,基于 Python 3.5 重写并扩充了部署、并发、异步编程等内容,章节结构也有调整。
书中内容今天还适用吗?
书中的语言机制与工程原则依然有效,但出版于 2017 年,涉及的具体工具(打包、CI、部署等)已有较大变化,实践时需结合当前版本,必要时查阅官方文档。

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