scryfall-py/scryfall/models/internal/protocols.py
2025-03-01 20:31:25 -07:00

17 lines
433 B
Python

import typing
from typing import Protocol, Any, TypeVar
from scryfall.client.route import Route
T_co = TypeVar("T", covariant=True) # type: ignore
@typing.runtime_checkable
class CanRequest(Protocol[T_co]):
async def request(
self,
route: Route,
params: dict | None = None,
**kwargs: dict,
) -> dict[str, Any]:
raise NotImplementedError("Derived classes need to implement this.")