- 博客(1)
- 收藏
- 关注
原创 python浅谈python@classmethod,@staticmethod
浅谈python@classmethod,@staticmethod 一、关于@classmethod ## 首先我们区分一下类属性和实例属性: 1.下面展示一些类属性代码。 # 1. 定义类,定义类属性 class Dog(object): tooth = 10 # 2. 创建对象 wangcai = Dog() xiaohei = Dog() # 3. 访问类属性: 类和对象 print(Dog.tooth) print(wangcai.tooth) print(xiaohei.toot
2020-12-07 21:57:21
188
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人