# 什么时候with操作 对象里面实现enter或者exit操作 就可以用with
class WithObject(object):
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb):
pass
什么 时候可以用with操作
猜你喜欢
转载自blog.csdn.net/weixin_42785547/article/details/85049650
今日推荐
周排行