...

摘要: ## 上下文管理器 ### 定义 - 包装任意代码 - 确保执行的一致性 ### 语法 - with语句 - __enter__和__exit__方法 ```python class ContextManager(object): def __init__(self): self.entered = 阅读全文
posted @ 2023-06-20 12:26 韩志超 阅读(49) 评论(0) 推荐(0) 编辑