4 ms·
Here some expression builder, with few renderers thereof, in one file, with some tests (beware: from 2012-2016) Was used to turn a python function into plain t
by svilen_dobrev 2y ago
Here some expression builder, with few renderers thereof, in one file, with some tests (beware: from 2012-2016)
Was used to turn a python function into plain text (textualize itself), into SQL-text (applicable as query), evaluate-numerically, translate into other languages, and the like.
https://github.com/svilendobrev/svd_util/blob/master/expr.py https://github.com/svilendobrev/svd_util/blob/master/expr.py
- philzook 2y agoThis looks like a nice reflection of python into a syntax tree, but unless I'm mistaken, it can't reflect python control structures like if-then-else? Z3 or sympy already are kind of ready to go systems that overload all the typical operators. Is there something you've done here they are missing?
- svilen_dobrev 2y agoThis is only expressions - what you can put inside a lambda. if-then-else are statements. The ternary op (Y if X else Z) probably was not yet there in 2012 - or i did not needed it. But You can add all other dunder operators if u need them..