from abc import abstractmethod from pydantic import BaseModel class BaseRedisModel(BaseModel): @abstractmethod def to_list(self) -> list: """Convert to list for Redis storage.""" pass @abstractmethod def count(self) -> int: """Return the number of elements in the list.""" pass @abstractmethod def delimiter(self) -> str: """Return the delimiter for the list.""" pass