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