python2.7, pscript and async/await statement, is it a bug or a limitation ?
manatlan opened this issue · 1 comments
manatlan commented
Hi,
If i made a python class with async/await statements, it translates great to JS when I use python3.
But it can't translate to JS when I use python2.7 :
File "<string>", line 9
async def inc(self,nb=1):
^
SyntaxError: invalid syntax
I known that async/await are py3 features. But when it comes to render to JS (which support async/await) ; is it possible to bypass this limitation (to be able to use async/await in JS) ?
thanks in advance
almarklein commented
No. PScript uses Python's buildin parser to generate the AST (abstract syntax tree) which is then used to generate the JavaScript. In other words, your code must be valid Python, subject to the used Python interpreter.