Are the following methods always equivalent within a class? In other words, within MyClass
can I interchangeably use cls
in a class method and MyClass
in a static method?
class MyClass:
@classmethod
def my_class_method(cls):
cls.attribute = "a"
@staticmethod
def my_non_class_method():
MyClass.attribute = "b"