jackyfkc.github.io

教土豆学计算机

惯用法

List Comprehensions

使用 with 进行资源管理

with is not just for resource management, but it’s a tool for factoring out common setup and teardown code, or any pair of operations that need to be done before and after another procedure