title: How to find slice object in numpy array
body: <p>I have a numpy array containing integers and slice objects, e.g.:</p>
  
  <pre><code>x = np.array([0,slice(None)])
  </code></pre>
  
  <p>How do I retrieve the (logical) indices of the integers or slice objects? I tried <code>np.isfinite(x)</code> (producing an error), <code>np.isreal(x)</code> (all <code>True</code>),  <code>np.isscalar(x)</code> (not element-wise), all in vain.
  What seems to work though is</p>
  
  <pre><code>ind = x&lt;np.Inf       # Out[1]: array([True, False], dtype=bool)
  </code></pre>
  
  <p>but I'm reluctant to use a numerical comparison on an object who's numerical value is completely arbitrary (and might change in the future?). Is there a better solution to achieve this?</p>