yggdrasil.pickle.ser.annotations¶
annotations ¶
dump_function_annotations ¶
dump_function_annotations(
annotations: Mapping[object, object] | None,
) -> tuple[int, dict[str, tuple[str, object]]]
Encode function annotations with per-entry fallback.
Any annotation entry that cannot be nested-serialized is downgraded to a string representation so function payload construction never fails because of annotation recursion/complexity.
load_function_annotations ¶
Decode function annotations payload.
Supports both the current encoded format and legacy raw dict payloads.
Any malformed entry is downgraded to a string representation instead of
raising, keeping function reconstruction resilient.