Registry / data / etuples

etuples

JSON →
library0.3.10pypypi✓ verified 24d ago

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 etuples
INSTALL
IMPORT
SIG · ETUPLES
E
etuples
datapythonv0.3.10
Install
1.8s avg
Import
132ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.10 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.136s · 18.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.128s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

etuple
from etuples import etuple
etuplize
from etuples import etuplize
ExpressionTuple
from etuples.core import ExpressionTuple

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.

from operator import add from etuples import etuple, etuplize # Create an expression tuple et = etuple(add, 1, 2) print(f"Expression: {et}") # Evaluate the expression result = et.eval() print(f"Result of evaluation: {result}") # etuplize can convert callables into etuples def my_func(a, b): return a * b et_func = etuplize(my_func) et_expression = et_func(3, 4) print(f"Et_expression: {et_expression}") print(f"Result of et_expression: {et_expression.eval()}")
Debug
Known issues
gotchaDo not confuse `etuple` objects with Python's built-in `tuple` type. `etuple` instances are specifically designed for S-expression emulation, representing an operation and its arguments as an unevaluated expression, rather than a simple immutable sequence.
fix
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.
affects: All versions
gotchaFailing to explicitly evaluate an `etuple` object will result in operating on the `ExpressionTuple` object itself, not its computed value. This is a common mistake when users expect immediate computation akin to function calls.
fix
Always call the `.eval()` method on an `ExpressionTuple` instance to get its computed result. For example, `my_etuple.eval()` instead of just `my_etuple`.
affects: All versions
gotchaAs `etuples` is in its 0.x version series, minor version increments (e.g., 0.3.x to 0.4.x) might introduce breaking API changes. Developers should review the changelog carefully when upgrading to a new minor version.
fix
Consult the GitHub release notes and changelog for each new minor version before upgrading in production environments.
affects: All 0.x versions
Errors
Common errors & fixes
AttributeError: 'Etuple' object has no attribute 'eval'
Developers incorrectly attempt to evaluate an 'etuple' object by calling an 'eval()' method, which does not exist; the evaluated result is accessed via the '.evaled_obj' attribute.
fix
Access the evaluated object using the '.evaled_obj' attribute: `evaluated_result = my_etuple.evaled_obj`
TypeError: 'Etuple' object is not callable
This error occurs when a developer attempts to call an 'etuple' instance directly as if it were a function, rather than using its intended methods or attributes for evaluation or interaction.
fix
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`.
NameError: name 'etuple' is not defined
The 'etuple' class (or 'etuplize' function) was used without being correctly imported from the 'etuples' library.
fix
Import the necessary components from the 'etuples' library: `from etuples import etuple, etuplize`
TypeError: 'tuple' object does not support item assignment
Like standard Python tuples, 'etuple' objects are immutable, meaning their elements cannot be changed after creation. This error occurs when an attempt is made to modify an element within an 'etuple'.
fix
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.
Upgrade
Version history
0.3.10latest on PyPI · released Jul 14, 2025
Audit
Dependencies
pythonrequiredRequires Python 3.9 or newer.
Agent activity
14 hits · last 30 days
node
12
Resources
etuples — pip install etuples · libregistry