标签:method on() pytho 推荐 访问 对象 eth person python
class Person:
@staticmethod # 静态方法
def yue():
print("fsadf")
# 静态方法可以使用对象访问. 也可以使用类名访问. 但是一般推荐使用类名访问
p = Person()
p.yue()
# 推荐使用类名访问
Person.yue()
标签:method on() pytho 推荐 访问 对象 eth person python
原文地址:https://www.cnblogs.com/demons97/p/10187481.html