transcrypt import in import
<p>Using Transcrypt for python to javascript compiling I have 2 modules that need each other. For example: </p>

<p>myTest.py:</p>

<pre><code>import myTest2
def test():
    myTest2.test()
someConstant = 1
</code></pre>

<p>and myTest2.py:</p>

<pre><code>import myTest
def test():
    console.log(myTest.someConstant)
</code></pre>

<p>After compiling to javascript, and calling <code>myTest.test()</code> I get an RangeError: Maximum call stack size exceeded.
How can I avoid this, but keep 2 modules which use each other?
Thanks in advance.</p>

<p>Try importing from <code>myTest</code> as and when you need it.</p>

<p>In <code>mytest2.py</code></p>

<pre><code>def test():
    from myTest import someConstant
    console.log(someConstant)
</code></pre>

javascript python transcrypt