Skip to content

Base

_base

BaseExtension

BaseExtension(client: _HTTPClientT_co)

Bases: ABC, Generic[_HTTPClientT_co, _CacheManagerT_co, _CacheGroupT_co]

The base extension class.

Parameters:

Name Type Description Default
client _HTTPClientT_co

The HTTP client to use for requests.

required

Attributes:

Name Type Description
_client _HTTPClientT_co

The HTTP client to use for requests.

_cache_manager _CacheManagerT_co

The top-level cache manager.

_cache_group _CacheGroupT_co

The category-specific cache group.

Source code in pokelance/ext/_base.py
def __init__(self, client: _HTTPClientT_co) -> None:
    self._client = client
    self._cache_manager = client.cache_manager
    self._cache_group = getattr(self._cache_manager, self.__class__.__name__.lower())

cache_group property

cache_group: _CacheGroupT_co

The cache group for this extension.

cache_manager property

cache_manager: _CacheManagerT_co

The top-level cache manager.

setup abstractmethod

setup() -> Coroutine[Any, Any, None] | None

Sets up the extension.

Source code in pokelance/ext/_base.py
@abc.abstractmethod
def setup(self) -> t.Coroutine[t.Any, t.Any, None] | None:
    """Sets up the extension."""
    raise NotImplementedError

Comments