title: Python Pylance unresolved import from class exposed by __init__.py
body: <h2>Issue</h2>
  <p>I'm working on updating an Python library to use modern versions of Python (the <code>Equation</code> library) and am having trouble with Pylance when importing from the module. The base form of the library also had this issue, but for reference, here's my fork: <a href="https://github.com/Antyos/Equation" rel="nofollow noreferrer">Antyos/Equation</a>.</p>
  <p>As the library describes, you are supposed to be able to import the <code>Expression</code> class like so:</p>
  <pre class="lang-py prettyprint-override"><code>from Equation import Expression
  
  e = Expression(&quot;sin(x+y^2)&quot;)
  </code></pre>
  <p>This code works, however, Pylance will give the following error:</p>
  <pre><code>&quot;Expression&quot; is unknown import symbol Pylance(reportGeneralTypeIssues)
  </code></pre>
  <p>If I import the code as follows, I don't receive the error and I can get type hints.</p>
  <pre class="lang-py prettyprint-override"><code>from Equation.core import Expression
  </code></pre>
  <h2>My Understanding</h2>
  <p>I roughly understand the issue--as shown in the file structure below, it makes sense that <code>from Equation.core import Expression</code> would work. I also understand that <code>__init__.py</code> is exposing the <code>Expression</code> class to the top level of the module. (I still don't totally get how this part works and I can't seem to find the right page/section detailing it.)</p>
  <pre class="lang-sh prettyprint-override"><code>Equation
  ├─ __init__.py
  ├─ _info.py
  ├─ core.py  # Contains Expression()
  ├─ equation_base.py
  ├─ equation_scipy.py
  ├─ similar.py
  └─ util.py
  </code></pre>
  <p>While I'm pretty sure I could get around this issue by writing a stub (<code>*.pyi</code>) file, it seems redundant (to me) to create a stub file for a class that I already have direct access to; why would I need to redefine something that's already there? However, it is also likely that I don't completely understand how stub files / module imports work and this is the right way.</p>
  <p>I'm sure this issue has been addressed before, but I think I've been using the wrong terminology. What am I missing?</p>