rberga06.utils.cache.FCacheArgOnly#

class rberga06.utils.cache.FCacheArgOnly(_: _T | _U | Literal[_Sentinels.DEFAULT] = _Sentinels.DEFAULT)#

Bases: FCache[tuple[object, …]]

A function cache that ignores **kwargs.

__init__(_: _T | _U | Literal[_Sentinels.DEFAULT] = _Sentinels.DEFAULT) None#

Methods

__init__([_])

clear()

Clar obj's cache (if any).

default()

The default value (empty cache).

func(f, /)

Cache f's calls (and exceptions!).

get(obj, /, *[, strict])

Return obj's cache (or raise ValueError(...) if strict, else return None).

has(obj, /)

Check if obj has a cache of this type.

read(*[, strict])

Read self's cache.

set(obj, /)

Decorator: set self as obj's cache.

Attributes

is_empty

clear() None#

Clar obj’s cache (if any).

classmethod default() dict[_K, tuple[object, bool]]#

The default value (empty cache).

func(f: _F, /) _F#

Cache f’s calls (and exceptions!).

classmethod get(obj: object, /, *, strict: bool = True) Self | None#

Return obj’s cache (or raise ValueError(…) if strict, else return None).

classmethod has(obj: object, /) TypeGuard[WithCache[Self]]#

Check if obj has a cache of this type.

read(*, strict: bool = False) _T | _U#

Read self’s cache.

set(obj: _X, /) _X#

Decorator: set self as obj’s cache.