title: Can I re-export a type from a different Python type stub file?
body: <p>I am writing type stubs for a proprietary Python platform. The platform often defines classes in some modules and re-export them from other modules. I need my type stubs to reflect that the type exists in more than one file.</p>
  <p>For example</p>
  <p>_foo.py:</p>
  <pre><code>class SomeType:
      # Implementation here
  </code></pre>
  <p>foo.py:</p>
  <pre><code>from _foo import SomeType
  </code></pre>
  <p>How do I write type stubs for these files?</p>
  <p>I have tried this:</p>
  <p>_foo.pyi:</p>
  <pre><code>class SomeType:
      ...
  </code></pre>
  <p>foo.pyi:</p>
  <pre><code>from _foo import SomeType
  </code></pre>
  <p>But it doesn't work, mypy throws this error:</p>
  <blockquote>
  <p>error: name 'foo.SomeType' is not defined</p>
  </blockquote>
  <p>Is there a way to make this work without copy-pasting the type stub into both files?</p>