查看原文
其他

【新书速递】流畅的Python第2版 Fluent Python , 2nd Edition

码中人 码农真经 2023-12-25

Fluent Python, 2nd Edition

Python’s simplicity lets you become productive quickly, but often this means you aren’t using everything it has to offer. With the updated edition of this hands-on guide, you’ll learn how to write effective, modern Python 3 code by leveraging its best ideas.

Don’t waste time bending Python to fit patterns you learned in other languages. Discover and apply idiomatic Python 3 features beyond your past experience. Author Luciano Ramalho guides you through Python’s core language features and libraries and teaches you how to make your code shorter, faster, and more readable.

Featuring major updates throughout the book, Fluent Python, second edition, covers:

  • • Special methods: The key to the consistent behavior of Python objects

  • • Data structures: Sequences, dicts, sets, Unicode, and data classes

  • • Functions as objects: First-class functions, related design patterns, and type hints in function declarations

  • • Object-oriented idioms: Composition, inheritance, mixins, interfaces, operator overloading, static typing and protocols

  • • Control flow: Context managers, generators, coroutines, async/await, and thread/process pools

  • • Metaprogramming: Properties, attribute descriptors, class decorators, and new class metaprogramming hooks that are simpler than metaclasses


Python的简单性使你能迅速提高工作效率,但这往往意味着你没有利用它所提供的一切。通过这本实践指南的更新版,你将学会如何利用Python 3的最佳理念来编写有效的、现代的代码。

不要浪费时间,让Python适应你在其他语言中学到的模式。发现并应用超出你过去经验的Python 3习惯性功能。作者Luciano Ramalho指导你学习Python的核心语言特性和库,并教你如何使你的代码更短、更快、更可读。

以整本书的重大更新为特色,《流畅的Python》第二版涵盖了以下内容:

  • • 特殊方法。Python对象一致行为的关键

  • • 数据结构:序列、数据集、集合、Unicode和数据类

  • • 作为对象的函数:一流的函数,相关的设计模式,以及函数声明中的类型提示

  • • 面向对象:组合、继承、混合、接口、操作者重载、静态类型和协议

  • • 控制流: 上下文管理器、生成器、循环程序、异步/等待和线程/进程池

  • • 元编程:属性、属性描述符、类装饰器,以及比元类更简单的新的类元编程钩。

往期推荐

关注 码中人

点赞、转发、广告,更多优质资源等你来...

(流畅的python)

欢迎关注我的公众号“码中人”,原创技术文章第一时间推送。


继续滑动看下一个

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存