Skip to main content

Module python

Module python 

Source
Expand description

python runtime — Python via RustPython.

RustPython is a pure-Rust Python 3 interpreter. It supports a substantial subset of CPython 3 — enough for arithmetic, list/dict comprehensions, string methods, f-strings, regex, json. It is not CPython: numpy / pandas / native extensions don’t run here.

Output capture strategy: instead of redirecting sys.stdout (which requires the full stdlib), we prepend a tiny Python prelude that shadows the global print with a function that appends to a list. After running, we read that list out of the scope and join it. Works without stdio / freeze-stdlib features, keeping the binary small.

Gated behind the lang-python feature.

Structs§

PythonRuntime
RustPython-backed runtime.