Avoid calling functions in hot loops (for performance)
ORM
Pony
Tortoise (async)
Core Python
Dataclasses
from dataclassses import dataclass, field
@dataclass(frozen=True, order=True)
class Comment:
id: int
text: str
replies: list[int] = field(default_factory=list)