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

Enum support? #758

Open mirryi opened 4 years ago

mirryi commented 4 years ago

I'm not sure if I'm missing something, but does Transcrypt support the enum module in the standard library?

I'm getting this error when trying to compile a package that uses enum.Enum:

Parsing module: /usr/lib/python3.8/enum.py
Generating code for module: /home/dophin2009/files/lfs/programming/stogacs/stogacs.club/__target__/enum.js
Parsing module: /home/dophin2009/.cache/pypoetry/virtualenvs/stogacs.club-55z-L0OC-py3.8/lib/python3.8/site-packages/transcrypt/modules/warnings/__init__.py
Generating code for module: /home/dophin2009/files/lfs/programming/stogacs/stogacs.club/__target__/warnings.js
Saving source map in: /home/dophin2009/files/lfs/programming/stogacs/stogacs.club/__target__/warnings.map
Saving target code in: /home/dophin2009/files/lfs/programming/stogacs/stogacs.club/__target__/warnings.js
Parsing module: /usr/lib/python3.8/types.py
Generating code for module: /home/dophin2009/files/lfs/programming/stogacs/stogacs.club/__target__/types.js
Parsing module: /usr/lib/python3.8/_collections_abc.py
Generating code for module: /home/dophin2009/files/lfs/programming/stogacs/stogacs.club/__target__/_collections_abc.js

Error while compiling (offending file last):
        File '/home/dophin2009/files/lfs/programming/stogacs/stogacs.club/src/components/MSTQuery/mstquery.py', line 6, at import of:
        File '/home/dophin2009/.cache/pypoetry/virtualenvs/stogacs.club-55z-L0OC-py3.8/src/mstat/mstat/__init__.py', line 7, at import of:
        File '/home/dophin2009/.cache/pypoetry/virtualenvs/stogacs.club-55z-L0OC-py3.8/src/mstat/mstat/record.py', line 3, at import of:
        File '/usr/lib/python3.8/enum.py', line 2, at import of:
        File '/usr/lib/python3.8/types.py', line 275, at import of:
        File '_collections_abc', line 56, namely:

        Can't import module '_collections_abc'

Aborted
JdeH commented 4 years ago

Enum isn't supported yet. Although it shouldn't be to hard to do, for now the accent is on moving to 3.9. Thanks!

zhoub commented 1 year ago

Sorry tried latest version this wasn't supported.

sawczakl commented 1 year ago

Still same in April 2023

jonathansekela commented 2 months ago

+1 on this. I'd love enum.Enum support as well. as of 15-Aug-2024 still not supported.