This is to report a difference in behaviour of 3.7 compared to 3.6 versions of transcrypt.
An import statement of the form 'from typing import Tuple' in python leads, unsurprisingly, to the following line in the produced javascript code:
import {Tuple} from './typing.js';
This, however, fails at javascript run-time, as Tuple is not actually exported from typing.js.
Note that functions from typing are never actually called, and commenting out the line in the javascript file leads to successful execution of the code.
NOTE: an easy workaround is to use 'import typing' in the python code instead. This leads, among other lines, to the following javascript code:
import * as __module_typing__ from './typing.js';
which is sufficiently nonspecific to pass at run-time.
An alternative solution for transcrypt would be to treat the typing module as a special case and not import it at all in the javascript code.
This is to report a difference in behaviour of 3.7 compared to 3.6 versions of transcrypt.
An import statement of the form 'from typing import Tuple' in python leads, unsurprisingly, to the following line in the produced javascript code: import {Tuple} from './typing.js'; This, however, fails at javascript run-time, as Tuple is not actually exported from typing.js. Note that functions from typing are never actually called, and commenting out the line in the javascript file leads to successful execution of the code. NOTE: an easy workaround is to use 'import typing' in the python code instead. This leads, among other lines, to the following javascript code: import * as __module_typing__ from './typing.js'; which is sufficiently nonspecific to pass at run-time. An alternative solution for transcrypt would be to treat the typing module as a special case and not import it at all in the javascript code.