摘要:
一、单继承下的属性查找 1 class Foo: 2 def f1(self): 3 print("Foo.f1") 4 5 def f2(self): 6 print("Foo.f2") 7 self.f1() # self => obj 8 9 10 class Bar(Foo): 11 def 阅读全文
posted @ 2021-07-14 20:13
Gnomeshghy
阅读(40)
评论(0)
推荐(0)
摘要:
一、绑定方法 绑定方法两种: 1、绑定给对象 1 # 绑定给对象的 2 class Student(): 3 country = 'CHINA' 4 5 def __init__(self, name, age): 6 self.name = name 7 self.age = age 8 9 de 阅读全文
posted @ 2021-07-14 14:58
Gnomeshghy
阅读(52)
评论(0)
推荐(0)

浙公网安备 33010602011771号