Fluent Python 2e 示例代码仓库,包含全书 24 章代码、Lisp 解释器修改版、测试脚本等。
章节目录
| 部分 | 章节 |
|---|---|
| I – Data Structures | Python Data Model、Sequences、Dictionaries、Unicode、Data Classes、Object References |
| II – Functions | First-Class Functions、Type Hints、Decorators、Design Patterns |
| III – OOP | Pythonic Object、Sequences、Interfaces、Inheritance、Type Hints、Operator Overloading |
| IV – Control Flow | Iterators、with/match、Concurrency、Executors、Async |
| V – Metaprogramming | Dynamic Attributes、Descriptors、Class Metaprogramming |
测试
# Doctests
python3 -m doctest frenchdeck.doctest -v
# Jupyter Notebook
pip install pytest nbval
pytest --nbvalWin 同步
git add . && git commit -m "sync" && git pushNorvig Lisp 解释器修改
original/:原始 lis.py、lispy.pypy3.10/:适配 Python 3.10,添加类型提示和模式匹配
关键修改:
Procedure类支持多表达式 bodylambda使用*body解包- 移除
global_env全局变量