class First:
@classmethod
def hello(self):
print(123)
class Second:
@classmethod
def hello(cls):
print(123)
obj1 = First()
obj2 = Second()
print(obj1.hello())
print(obj1.hello())
I am not getting any error while calling obj1
(with self
as argument) and obj2
(with cls
as argument). Why not? Is the classmethod decorator able to use cls
/self
?