Why should I use a classmethod in python?
Why should I use a classmethod in python? Question: I am writing a function in some class in python, and people suggested to me to add to this function a @classmethod decorator. My code: import random class Randomize: RANDOM_CHOICE = ‘abcdefg’ def __init__(self, chars_num): self.chars_num = chars_num def _randomize(self, random_chars=3): return ”.join(random.choice(self.RANDOM_CHOICE) for _ in …