企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~python class Player: def __enter__(self): print('enter') return self def __exit__(self, exc_type, exc_val, exc_tb): if exc_tb: print("process exp") else: print("no exception") print('exit') return True with Player() as player: print('player with') print(player) ~~~