Introduction
Pythonic思维
列表生成式
使用生成器
enumerate和zip
for except else finally
函数
将return None替换为raise异常
iterator作为函数对象要对加注意
关于函数参数
闭包和装饰器
类
使用helper class作为bookkeeping
不要对OOP迷信
使用super初始化父类
使用classmethod实现函数构造的多态
多继承优先使用mixin模式
collections.abc
属性访问
metaclass的用法
杂项
functools.wraps
contextlib
使用built-in的数据结构和算法
docstring
定义root异常
防止循环引用
在调试中使用repr而不是print
cProfile
tracemalloc
并行
多线程
协程
多进程
Published with GitBook
使用classmethod实现函数构造的多态
使用classmethod实现函数构造的多态
results matching "
"
No results matching "
"