etuples is a Python library that provides S-expression emulation using tuple-like objects. It allows for the creation of functional expression trees that can be explicitly evaluated. The library is currently at version 0.3.10 and has an active development status with several releases in the past year.
pip install etuplesVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create basic S-expression-like tuples using `etuple`, how to evaluate them, and how to use `etuplize` to convert a regular callable into an expression-tuple factory.
Always remember that `etuple` objects require explicit evaluation (e.g., using `.eval()` or `apply(rator(et), rands(et))`) to compute their result, unlike standard Python tuples which are simple data structures.
Always call the `.eval()` method on an `ExpressionTuple` instance to get its computed result. For example, `my_etuple.eval()` instead of just `my_etuple`.
Consult the GitHub release notes and changelog for each new minor version before upgrading in production environments.
Access the evaluated object using the '.evaled_obj' attribute: `evaluated_result = my_etuple.evaled_obj`
Ensure you are not using parentheses `()` directly after an 'etuple' instance unless you intend to call an attribute that is callable. To access the evaluated result, use `my_etuple.evaled_obj`.
Import the necessary components from the 'etuples' library: `from etuples import etuple, etuplize`
If modification is required, create a new 'etuple' with the desired changes or use a mutable data structure (like a list) if in-place modification is essential.