from dataclasses import dataclass, field import uuid @dataclass class Product: name: str uuid: str = field(default_factory=lambda: str(uuid.uuid4()))