Skip to Content
流畅的Python(第2版)
book

流畅的Python(第2版)

by Luciano Ramalho
April 2023
Intermediate to advanced
769 pages
25h 16m
Chinese
Posts & Telecom Press
Content preview from 流畅的Python(第2版)
前言
iii
第二部分 函数即对象
第二部分探讨作为
Python
语言一等对象的函数
,说明这意味着什么、对一些流行的
设计模式有何影响,以及如何利用闭包(
closure
)实现函数装饰器
。这一部分还涉及
Python
可调用对象的概念、函数属性、内省(
introspection
)、参数注解,以及
Python 3
新引入的
nonlocal
声明。第
8
章介绍重要的新功能类型提示在函数签名中的使用。
第三部分 类和协议
第三部分的重点转移到自己动手构建类上,这与第
5
章介绍的类构建器截然不同
。与其
他面向对象语言一样,
Python
自己的一套功能,可能并不会出现在你我学习过的其他
基于类的编程语言中。这一部分的各章说明如何自己动手构建容器、抽象基类和协议,
以及如何处理多重继承、如何在必要时实现运算符重载。第
15
章继续讲解类型提示。
第四部分 控制流
第四部分涵盖
Python
中除条件判断
、循环和子程序(
subroutine
)等传统的控制流以外
的语言结构和库。先讲生成器(
generator
,再讲上下文管理器(
context manager
)和
协程(
coroutine
,还涉及新增的功能强大但不容易理解的
yield from
句法。第
18
有一个重要的示例:在一个简单的函数式语言的解释器中使用模式匹配。新增的第
19
章概述
Python
并发和并行处理的各种方案及其局限性
,以及使
Python Web
应用程序具
有良好伸缩性能的软件架构。为了强调语言核心功能,例如
await
async dev
async
for
async ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python高级编程(第2版)

Python高级编程(第2版)

Posts & Telecom Press, Michał Jaworski, Tarek Ziadé
Python贝叶斯分析(第2版)

Python贝叶斯分析(第2版)

Posts & Telecom Press, Osvaldo Martin
高效能PYTHON程式設計

高效能PYTHON程式設計

Micha Gorelick, Ian Ozsvald

Publisher Resources

ISBN: 9787115612366