Python __析构方法__del__
时间:2017-08-21 14:23:53
收藏:0
阅读:316
class Foo:
def __init__(self,x):
self.x=x
def __del__(self): #在对象资源被释放时触发
print(‘-----del------‘)
print(self)
f=Foo(100000)
del f
print(‘=======================>‘)
原文:http://www.cnblogs.com/wangmengzhu/p/7404098.html
评论(0)