python面向对象:__del__函数使用,python__del_,class Life:
文章由Byrx.net分享于2019-03-23 07:03:16
python面向对象:__del__函数使用,python__del_,class Life:
class Life: def __init__(self, name='unknown'): print 'Hello', name self.name = name def __del__(self): print 'Goodbye', self.namebrian = Life('Brian')brian = 'loretta'print 'Before delete'print briandel brianprint 'after delete'
相关内容
- python Class: __getitem__ 示例,python__getitem_,class indexe
- python输出系统用户,python输出用户,import ospri
- Provide custom type infomation,provideinfomation,class MyMeta
- 重写类的__str__方法,重写类__str_,class MyMeta
- python的 slots使用,pythonslots使用,class PointW
- 使用lambda表达式获得系统参数,lambda表达式,import comm
- 输出python的系统参数,输出python参数,import osimp
- python读取邮件帐户信息,python读取邮件,import mailb
- python类实例设置,python类实例,class Foo :
- python构造函数示例,python构造函数,class Studen
评论关闭