@classmethod
decorator PYL-R0202 29 def cmethod(cls, something):
30 """class method-to-be"""
31
32 cmethod = classmethod(cmethod) 33
34
35class RandomNumberGenerator:
It is recommended to use the decorator syntax to declare a classmethod. Read more about classmethod here
class MyClass:
def cmethod(cls):
'''class method-to-be'''
# Convert cmethod to `classmethod`
cmethod = classmethod(cmethod)
class MyClass:
@classmethod
def cmethod(cls):
'''class method-to-be'''