Best s-expression builder targeting Python bytecode
Project description
PySExpr of Python-Compiler-Tools
A general-purpose package for gaining expression-first capability in Python world. Current implemented by taking advantage of Python bytecode, and available since Python 3.5, i.e., by using PySExpr as a cross-version compiler, you don't have to worry about the Python version.
See documentation.
All constructors of PySExpr are documented here.
Installation
pip install pysexpr
Preview
from py_sexpr.terms import *
from py_sexpr.stack_vm.emit import module_code
xs = []
main = for_range("a", 1, 10, call(var("print"), var("a")))
exec(module_code(main), dict(print=xs.append))
assert xs == [1, 2, 3, 4, 5, 6, 7, 8, 9]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
pysexpr-0.2.1-py3-none-any.whl
(12.8 kB
view hashes)