阅读背景:

Python内置对象的__enter __()和__exit __()定义在哪里?

来源:互联网 

I've read that the object's __ enter__() and __ exit__() methods are called every time 'with' is used. I understand that for user-defined objects, you can define those methods yourself, but I don't understand how this works for built-in objects/functions like 'open' or even the testcases.I've read that the object's __ enter__() and __




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: