title: Determine if Python variable is an instance of a built-in type
body: <p>I need to determine if a given Python variable is an instance of native type: <code>str</code>, <code>int</code>, <code>float</code>, <code>bool</code>, <code>list</code>, <code>dict</code> and so on. Is there elegant way to doing it?</p>
  
  <p>Or is this the only way: </p>
  
  <pre><code>if myvar in (str, int, float, bool):
      # do something
  </code></pre>