TranscryptOrg / Transcrypt

Python 3.9 to JavaScript compiler - Lean, fast, open!
https://www.transcrypt.org
Apache License 2.0
2.86k stars 215 forks source link

Missing types in the typing module #843

Open chrisyokum opened 1 year ago

chrisyokum commented 1 year ago

When using the -xr flag, if the missing types are used in the module, an error occurs:

✘ [ERROR] No matching export in "src/typing.js" for import "List"

    src/test.js:4:13:
      4 │ import {Any, List} from './typing.js';
        ╵              ~~~~

This can be corrected by adding the missing types to transcrypt/modules/typing/__init__.py

# Dummy to allow references and re-exports of typing classes

Any = 'Any' 
Callable = 'Callable' 
ClassVar = 'ClassVar' 
Dict = 'Dict' 
Iterator = 'Iterator' 
List = 'List' 
Optional = 'Optional'
Tuple = 'Tuple' 
Type = 'Type'
Union = 'Union'
#etc...