title: Python type hinting without cyclic imports
body: <p>I'm trying to split my huge class into two; well, basically into the &quot;main&quot; class and a mixin with additional functions, like so:</p>
  <p><code>main.py</code> file:</p>
  <pre><code>import mymixin.py
  
  class Main(object, MyMixin):
      def func1(self, xxx):
          ...
  </code></pre>
  <p><code>mymixin.py</code> file:</p>
  <pre><code>class MyMixin(object):
      def func2(self: Main, xxx):  # &lt;--- note the type hint
          ...
  </code></pre>
  <p>Now, while this works just fine, the type hint in <code>MyMixin.func2</code> of course can't work. I can't import <code>main.py</code>, because I'd get a cyclic import and without the hint, my editor (PyCharm) can't tell what <code>self</code> is.</p>
  <p>I'm using Python 3.4, but I'm willing to move to 3.5 if a solution is available there.</p>
  <p>Is there any way I can split my class into two files and keep all the &quot;connections&quot; so that my IDE still offers me auto-completion and all the other goodies that come from it knowing the types?</p>