kotlin-python
kotlin-python copied to clipboard
Adjust for no `__new__` method on MicroPython
When trying to run e2e tests for MicroPython, the constructors test fails with:
File "python/e2e-tests/out/python-consumer.py", line 6, in <module>
File "/home/piotr/repos/priv/kotlin-python/python/e2e-tests/out/compiled.py", line 13692, in multi12
File "/home/piotr/repos/priv/kotlin-python/python/e2e-tests/out/compiled.py", line 13670, in MultiConstructors1_init__Create_
AttributeError: type object 'MultiConstructors1' has no attribute '__new__'
Looks like __new__
is another magic method unavailable on MicroPython. We had to use +
instead of __add__
already. Not sure if there's an equivalent here, but still it's a must to fix it given we want to support MP.
TODO: check why __new__
(magic method) was used, and if some non-magic method can be used instead.