fleche.call
Attributes
Classes
Represents a function call, capturing its name, arguments, and keyword arguments. |
|
A Call where arguments and result are |
|
Functions
|
Thin wrapper around |
Module Contents
- fleche.call.bind(func, args, kwargs, apply_defaults=False, partial=False)[source]
Thin wrapper around
inspect.Signature.bind()/bind_partial().- Parameters:
func – The callable whose signature to bind against.
args – Positional arguments.
kwargs – Keyword arguments.
apply_defaults – If
True, fill in default values for parameters that were not explicitly supplied.partial – If
True, usebind_partial(), which allows required arguments to be omitted (treated as wildcards).
- Returns:
inspect.BoundArguments.arguments— anOrderedDictcontaining the supplied (and, when requested, defaulted) values.
- 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.
- to_lookup_key() fleche.digest.Digest[source]
- _to_digested(save_fn: Callable[[Any], fleche.digest.Digest]) DigestedCall[source]
Generic conversion to DigestedCall using save_fn to handle each value.
- stash(values) DigestedCall[source]
Save arguments and result into values, returning a
DigestedCall.Result save errors propagate to the caller. Argument save errors fall back to a digest-only reference (the value is hashed but not stored).
- Parameters:
values – A
ValueStorageinstance to persist values into.- Returns:
A
DigestedCallwith all argument values and the result replaced by theirDigestkeys.
See also
digest()for a variant that does not write to storage.
- digest() DigestedCall[source]
Digest arguments and result without saving to storage, returning a
DigestedCall.Equivalent to
stash()but usesdigest()instead ofvalues.save, so no data is written anywhere.
- class fleche.call.DigestedCall[source]
A Call where arguments and result are
Digestpointers into a value store.Produced by
Call.stash()orCall.digest(); represents a call whose values have been replaced by their content-addressed keys.- arguments: dict[str, fleche.digest.Digest][source]
- result: fleche.digest.Digest | None = None[source]
- to_lookup_key() fleche.digest.Digest[source]
- class fleche.call.QueryCall[source]
-
- code_digest: fleche.digest.Digest | None = None[source]
- matches(other: Call | LazyCall | DigestedCall) bool[source]
Check if this call matches another call, treating None as a wildcard in this object.