Python - Class Methods and Static Methods
You want to create a class method that returns a new instance of the class with default values. Which of these implementations is correct?
class User:
def __init__(self, name, age):
self.name = name
self.age = age
@classmethod
def default_user(cls):
return cls("Guest", 0)