title: How to find out if the Sympy variable is complex?
body: <p>I am writing a code which involves solving this equation</p>
  
  <pre><code>X = solve(Theta_Mod_Eqn*Ramp_Equation/(x+PT) - C, x)
  </code></pre>
  
  <p>I am using sympy library, now the equation has 7 roots few are complex and few are real. I am unable to segregate them because <code>isinstance(i,complex)</code> is always returning true</p>
  
  <pre><code>for i in X:
      if not isinstance(i,complex):
          if (i&gt;-0.01 and i&lt;maxSheaveDisp):
              A = i;
  </code></pre>
  
  <p>for one case 
      i = -0.000581431210287302 - 0.2540334478167*I</p>
  
  <pre><code>In:i == complex
  Out[39]: False
  </code></pre>
  
  <p>How to find out if the variable is complex?</p>