Utilities & globals
Smaller helpers and constants that round out the public surface. All are
importable from the top-level pyccolo package.
Tracer stack & contexts
- pyccolo.tracer() BaseTracer[source]
- pyccolo.instance() BaseTracer[source]
- pyccolo.resolve_tracer(ref: str) Type[BaseTracer][source]
Frames & guards
- pyccolo.set_frame_local(frame: FrameType, name: str, value: Any) None[source]
Assign
name = valueinframe’s local scope so a running function observes the write.A frame’s
f_localsis normally a read-only view from the outside: on CPython < 3.13 it is a snapshot dict, and mutating it does not touch the frame’s fast-locals array unlessPyFrame_LocalsToFastcopies the snapshot back. On 3.13+ (PEP 667)f_localsis a write-through proxy, so assigning to it is sufficient. This is the primitive pipescript uses to give macro block bodies write-back semantics into their enclosing function.Only names that already have a local slot in
frame(function parameters and variables assigned somewhere in the enclosing function) are guaranteed to persist;PyFrame_LocalsToFastwill not create a brand-new fast slot.
- pyccolo.PYCCOLO_BUILTIN_PREFIX
The prefix used for the synthetic builtins Pyccolo injects (guard names, macro hooks). Handy when generating guard names or namespacing your own injected symbols.
Traceback visibility
By default, frames from sandboxed exec/eval code are hidden from
tracebacks. These let you opt specific sandbox files back in.
- pyccolo.mark_traceback_visible(filename: str) None[source]
Mark
filenameas a sandbox file worth showing in tracebacks.
- pyccolo.is_traceback_visible(filename: str) bool[source]
Whether
filenamewas marked visible viamark_traceback_visible().
Sentinels
The handler return-value sentinels are documented with the handler
contract: Null, Skip,
SkipAll, and Pass.