摘要:
# 构造方法:申请一个空间# 析构方法: 释放一个空间# 垃圾回收机制 class File: def __init__(self, file_path): self.f = open(file_path) self.name = 'Alex' def read(self): self.f.read 阅读全文
posted @ 2021-02-23 20:58
跳动0101
阅读(66)
评论(0)
推荐(0)
摘要:
一、__call__方法: class A: def __call__(self,*args,**kwargs): print(print('执行了call方法了')) class B: def __init__(self, cls): self.a = cls() self.a() # a = A 阅读全文
posted @ 2021-02-23 11:00
跳动0101
阅读(87)
评论(0)
推荐(0)

浙公网安备 33010602011771号