title: Why is numpy.int32 not recognized as an int type
body: <p>I just spent half an hour looking into a bug in statsmodels' SARIMAX functionality that I could finally trace back to the fact that numpy.int32 fails type checks for int.</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; foo = np.int32(3)
  &gt;&gt;&gt; isinstance(foo, int)
  False
  </code></pre>
  
  <p>Is there a way to circumvent this kind of issue without explicit type conversions?
  Should proper code even test for types and not check if a variable can safely be cast to a type?</p>
  
  <p>Edit: My question is answered by an account of what technical limitations or design decisions are the cause of this behaviour and how to pythonically handle cases where both pure python's <code>int</code> and numpy <code>int32</code> or <code>int64</code> types might appear.</p>