<br><br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div><div dir="auto">Many features on this list propose different syntax to python, producing different python "dialects" that can statically be transformed to python :
<div dir="auto"><br>
</div>
<div dir="auto">- a,b += f(x) → _t = f(x); a += _t; b += _t;  (augmented assignement unpacking)</div>
<div dir="auto">- a = 2x + 1 → a = 2*x + 1  (juxtaposition is product)</div>
<div dir="auto">- f(*, x, y) → f(x=x, y=y)  (simplekwargs)</div>
<div dir="auto">- DSL specific language</div>
<div dir="auto">- all def become @partially def</div>
<div dir="auto">- etc...</div>
<div dir="auto"><br>
</div>
<div dir="auto">Using a modified version of ast, it is relatively easy to modifiy the syntax tree of a program to produce another program. So one could compile the "python dialect" into regular python. The last example with partially for example doesn't even
 need new syntax.</div></div></div></blockquote><div><br></div><div>For my specific suggestion (simplekwargs), it's really not worth doing at all if it's not a part of standard Python in my opinion. The reason is tooling: you wouldn't get tools like Jedi and PyCharm to read these files and interpret them correctly.</div><div><br></div><div>That being said, it could absolutely be a nice way to prototype things or for very edge cases. I'd recommend looking into parso (the AST lib that underlies Jedi). I used it for the analysis tool I wrote for simplekwargs and I've also used it to write my mutation tester mutmut. It has several advantages:</div><div><br></div><div>- it's a roundtrip AST so you wouldn't lose any formatting or comments etc</div><div>- it has an error recovery mode where parse errors are isolated in the AST as error nodes. You could probably use this to just enumerate error nodes and doing .get_code() on them and then have all your special parsing in there.</div><div>- it is very liberal in what it accepts putting into an AST that it renders out to source again so it's quite easy to hack something together that works</div><div><br></div><div>/ Anders</div>