📅  最后修改于: 2022-03-11 14:45:11.268000             🧑  作者: Mango
# With classmethods, the class of the object instance is
# implicitly passed as the first argument instead of self.
class A(object):
def foo(self, x):
print(f"executing foo({self}, {x})")
@classmethod
def class_foo(cls, x):
print(f"executing class_foo({cls}, {x})")
@staticmethod
def static_foo(x):
print(f"executing static_foo({x})")
a = A()