{"id":3992,"library":"etuples","title":"etuples","description":"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.","status":"active","version":"0.3.10","language":"en","source_language":"en","source_url":"https://github.com/pythological/etuples","tags":["s-expression","tuple","functional programming","expression trees","lisp"],"install":[{"cmd":"pip install etuples","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"symbol":"etuple","correct":"from etuples import etuple"},{"symbol":"etuplize","correct":"from etuples import etuplize"},{"symbol":"ExpressionTuple","correct":"from etuples.core import ExpressionTuple"}],"quickstart":{"code":"from operator import add\nfrom etuples import etuple, etuplize\n\n# Create an expression tuple\net = etuple(add, 1, 2)\nprint(f\"Expression: {et}\")\n\n# Evaluate the expression\nresult = et.eval()\nprint(f\"Result of evaluation: {result}\")\n\n# etuplize can convert callables into etuples\ndef my_func(a, b):\n    return a * b\n\net_func = etuplize(my_func)\net_expression = et_func(3, 4)\nprint(f\"Et_expression: {et_expression}\")\nprint(f\"Result of et_expression: {et_expression.eval()}\")","lang":"python","description":"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."},"warnings":[{"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.","message":"Do 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.","severity":"gotcha","affected_versions":"All versions"},{"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`.","message":"Failing 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the GitHub release notes and changelog for each new minor version before upgrading in production environments.","message":"As `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.","severity":"gotcha","affected_versions":"All 0.x versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}