Using Marshmallow without repeating myself
问题 According to the official Marshmallow docs, it's recommended to declare a Schema and then have a separate class that receives loaded data, like this: class UserSchema(Schema): name = fields.Str() email = fields.Email() created_at = fields.DateTime() @post_load def make_user(self, data): return User(**data) However, my User class would look something like this: class User: def __init__(name, email, created_at): self.name = name self.email = email self.created_at = created_at This seems like