title: How does one check if a variable is a sympy expression?
body: <p>I wanted to check a python variable is a sympy expression. Its easy to check if its a sympy variable with:</p>
  
  <pre><code>isinstance(arg, symbol.Symbol)
  </code></pre>
  
  <p>but I can't find how to do:</p>
  
  <pre><code>isinstance(arg, sympy.Expression)
  </code></pre>
  
  <p>is it possible to check if a python variable holds a sympy expression or a variable? </p>
  
  <hr>
  
  <p>as a quick check I did:</p>
  
  <pre><code>expr2 = x-y
  type(expr2)
  &lt;class 'sympy.core.add.Add'&gt;
  </code></pre>
  
  <p>but I don't want to have a giant series if statement clause checking each possible type of maths expression. Seems redundant/silly.</p>
  
  <hr>
  
  <p>It would also nice to be able to detect when a variable is of any type of sympy related thing and then act on it (and then maybe later check if its an expression or something more detailed...)</p>