-
Notifications
You must be signed in to change notification settings - Fork 26
Description
I am looking for a python to JS implementation to run within or alongside https://github.com/adsharma/py2many , and running pj on the tests in https://github.com/adsharma/py2many/tree/main/tests/cases I found some issues, that I thought worth sharing. See metapensiero/metapensiero.pj#61 for the same in an alternative project.
I initially tried with the PyPI release, and found it doesnt support AnnAssign very well. Using master works a bit better, but still fails https://github.com/adsharma/py2many/blob/main/tests/cases/rect.py with "Cannot convert AnnAssign nodes with no assignment!" due to using dataclasses.
Another set of tests fail due to no "Set", which is already raised as #24 .
https://github.com/adsharma/py2many/blob/main/tests/cases/exceptions.py is an interesting one -- most Python transpilers dont handle this, and pscript does quite well, except it doesnt detect the divide-by-zero, as this returns Infinity on JavaScript, not an exception.
Also a special mention, bitops.py works correctly, where most Python->JavaScript transpilers cant do this (and often wontfix it).
Other failures:
comb_sort.py, Cant importmath.floorbyte_literals.py: "No Bytes in JS". Isnt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer good enough?coverage.py:len(Dict)is converted to object.length, which returnsundefinedinfer_ops.py: Cant import ctypes. Could be ignored liketyping. e.g.Line 853 in d239a23
if node.root == 'typing':