摘要:
Object References, Mutability, and Recycling 本章章节: Variables Are Not Boxes identity , Equality , Aliases Copies are shallow by default Function Parame 阅读全文
摘要:
Function Decorators and Closures 装饰器是用于增强函数的行为,理解它,就必须先理解闭包。 Python3引入关键字nonlocal,如果要理解闭包,就必须了解它的所有方面,包括nonlocal的使用。 闭包在装饰器中有用,另一个用处是回调方式的异步编程和函数方式编程的 阅读全文