title: Why does PyCharm complain that `Expected type 'Tag', got 'str' instead`?
body: <p>I have defined a variable <code>offer</code> which has the type of <code>bs4.element.Tag</code>. I have also defined a function <code>get_price</code> which scrapes the price from this tag and returns it as a string. When I run the following code:</p>
  <pre><code>def get_price(row: bs4.element.Tag) -&gt; str:
      wrapper = row.find('td', class_='item_price')
      price = wrapper.find('span', class_='price')
  
      try:
          price_stripped = price.text.strip()
      except AttributeError:
          price_stripped = ''
  
      return price_stripped
  
  print(type(row))
  print(get_price(row))
  </code></pre>
  <p>I get</p>
  <pre><code>&lt;class 'bs4.element.Tag'&gt;
  €25.00
  </code></pre>
  <p>which is the output I expected. However, why does PyCharm complain that <code>Expected type 'Tag', got 'str' instead</code> at the last line of my code? I'm confused as I believe I passed an object of type 'Tag' to <code>get_price</code>, so it doesn't make sense to me why PyCharm 'thinks' I passed it an object of type <code>str</code>.</p>