from dataclasses import dataclass from typing import Generic, TypeVar T = TypeVar('T') @dataclass class Items(Generic[T]): """Data class to represent an items list with total count.""" items: list[T] total_count: int