title: How to get type annotation from stub files (.pyi) at runtime in Python?
body: <p>I want to get the annotations at functions or class methods.If the type hintings are written in the source code, then I can get types by getting attribute <code>__annotations__</code>.</p>
  
  <pre class="lang-py prettyprint-override"><code>def hoge(n: int): ...
  print(hoge.__annotations__)  # {'n': &lt;class 'int'&gt;}
  </code></pre>
  
  <p>But I don't know how to get types written in stub files (.pyi).</p>
  
  <pre class="lang-py prettyprint-override"><code># .pyi
  def fuga(n: int): ...
  
  # .py
  def fuga(n): ...
  print(fuga.__annotations__)  # {}
  </code></pre>
  
  <p>Is there any cool method?</p>