class student(): position='即令' def __init__(self,name,age): self.name=name self.age=age def eat(self): pass @classmethod def cla(cls): pass @staticmethod def sta(): pass pass stu=student(name='张三',age='12') print(stu.position) stu.sta() stu.cla() # 直接使用静态和类方法 student.cla() student.sta() # 动态邦参 def show(): pass stu.show=show stu.show()