Skip to main content

Module python

Module python 

Source
Expand description

Python (with optional JAX) backend for tpt-telos.

Generates Python @dataclass-based structs with runtime contract assertions and satisfies_invariants() methods, mirroring the Rust and Go backends. Functions carry runtime pre/post-condition asserts so contracts are enforced at every boundary crossing, even from uninstrumented callers.

Activate with @boundary(ml_training), @boundary(python), or @boundary(jax). The JAX variant adds import jax.numpy as jnp and uses jnp.int64 type hints.

Functionsยง

generate_python_package
Generate a full Python module source for the given telos modules.