title: How to set sys.modules["m"]=<current module>
body: <p>I have this structure:</p>
  
  <pre><code>merged.py:
    everything
  
  main.py:
    import merged
    sys.modules['othermodule'] = merged
    othermodule.f()
  </code></pre>
  
  <p>If I merged this into single file <code>main.py</code>, is there any way to tell <code>othermodule</code> resolve to <code>main</code> while inside of <code>main.py</code>?</p>
  
  <p>This situation happens when using <a href="https://github.com/xonsh/amalgamate" rel="nofollow">amalgamate</a> package to concat everything into single file, but the result is two files with structure like above, and I'm trying to get it down to one file</p>