title: How to check type of object in Python?
body: <p>I have some value in variable <code>v</code>, how to check it's type?</p>
  
  <p>Hint: it is NOT <code>v.dtype</code>.</p>
  
  <p>When I do <code>type(v)</code> in debugger, I get </p>
  
  <pre><code>type(v) = {type} &lt;type 'h5py.h5r.Reference'&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>type(v) = {type} &lt;class 'h5py._hl.dataset.Dataset'&gt;
  </code></pre>
  
  <p>How to check these value at runtime?</p>
  
  <p>"Check" means calculate boolean result, saying if the type is given.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In so called "duplicate" question, it is said, that to compare type one should use</p>
  
  <pre><code>type(v) is str
  </code></pre>
  
  <p>which implicitly assume that types are strings. Are they?</p>