fleche.call

Attributes

AnyCall

Classes

Call

Represents a function call, capturing its name, arguments, and keyword arguments.

LazyCall

QueryCall

Module Contents

class fleche.call.Call[source]

Represents a function call, capturing its name, arguments, and keyword arguments.

module and version can be optionally set to be included in the hash of the call. version should be a plain integer and monotonically increase. Each different version will completely change the hash of the call, invalidating previously cached results.

name: str[source]
arguments: dict[str, Any][source]
metadata: dict[str, dict[str, Any]][source]
module: str | None = None[source]
version: int | None = None[source]
code_digest: str | None = None[source]
result: Any = None[source]
classmethod from_call(func, *args, **kwargs)[source]
to_lookup_key()[source]
matches(other: Call | LazyCall) bool[source]

Check if this call matches another call, treating None as a wildcard in this object.

class fleche.call.LazyCall[source]
name: str[source]
_arguments: dict[str, Any][source]
_result: Any[source]
_cache: Any[source]
metadata: dict[str, dict[str, Any]][source]
module: str | None = None[source]
version: int | None = None[source]
code_digest: str | None = None[source]
property arguments[source]
property result[source]
to_lookup_key() str[source]
fetch() Call[source]

Reconstruct a full Call object by loading all values from the cache.

__digest__()[source]
class fleche.call.QueryCall[source]
name: StrQueryType = None[source]
arguments: dict[str, AnyQueryType] | None = None[source]
metadata: dict[str, dict[str, StrQueryType]] | None = None[source]
module: str | None = None[source]
version: int | None = None[source]
code_digest: fleche.digest.Digest | None = None[source]
result: AnyQueryType = None[source]
classmethod from_call(func, *args, **kwargs)[source]
matches(other: Call | LazyCall) bool[source]

Check if this call matches another call, treating None as a wildcard in this object.

fleche.call.AnyCall[source]