Home
Overview
Fundamentals
Glossary
Cheatsheet
API Reference
Quick Recipes
Deep Dive
Common Pitfalls and Gotchas
Persistent Storage
Eager-only functor utilities.
kd_ext.functor.to_py(fn: DataItem, name: str = 'top') -> ModuleConverts a Koda Functor into a Python ast.Module.
The returned module contains one ast.FunctionDef per subfunctor, ordered
topologically (leaves first). All non-root function defs are decorated with
@kd.trace_as_fn().
Args:
fn: The Koda Functor to convert.
name: The name to use for the root function (default: 'top').
Returns:
An ast.Module containing all function definitions.