Open sandeep-gh opened 2 years ago
I created a module to test this and to get around some namespace confusion, I changed the import in my test from
from addict import Dict
to
from addict.addict import Dict
and bypassed the addict/__init__.py
module. And while this got around one problem, Transcrypt wouldn't process the library anyway:
$ transcrypt --nomin --verbose addict_test.py
Error while compiling (offending file last):
File 'addict_test.py', line 1, at import of:
File 'addict.addict', line 35, namely:
Built in function 'super' with arguments not supported
Aborted
It appears that the addict
library has a few lines of Python code that Transcrypt is unable to process in its current form.
Transcrypt runs without error and produces output when ran over addict.py (a library on top of Dict, that uses some python dunder function hooks to make dictionary operations via class/object access patterns). I am using this https://github.com/sandeep-gh/addict fork.
Transcrypt compiles addict and reports no error. However, the generated javascript has no code corresponding to addict functions and it seems to have created a recursive definition which breaks rollup bundler (see Circular Dependency) Attached below is the relevant snippet of the generate
addict.js
.The import line seems to be creating a circular dependency since within addict.js we are saying import Dict from addict.js. Are libraries like addict.py not transcryptable? Any high level idea how to debug/fix would be great.