Код: Выделить всё
class A:
@staticmethod
def f(x):
print("x is", x)
class B:
def f(x):
print("x is", x)
Код: Выделить всё
>>> A.f(1)
x is 1
>>> B.f(1)
x is 1
Подробнее здесь: https://stackoverflow.com/questions/550 ... o-anything
Код: Выделить всё
class A:
@staticmethod
def f(x):
print("x is", x)
class B:
def f(x):
print("x is", x)
Код: Выделить всё
>>> A.f(1)
x is 1
>>> B.f(1)
x is 1