title: How to safely save and load sympy objects
body: <p>Is there an official way to safely save and load sympy objects (for sending over the internet)? </p>
  
  <p>using <code>np.save</code> and <code>np.load</code> give the following exception.</p>
  
  <pre><code>Traceback (most recent call last):
    File "testSave.py", line 19, in &lt;module&gt;
      print np.load("out.npy", out)
    File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 415, in load
      if mmap_mode:
    File "C:\Python27\lib\site-packages\sympy\core\relational.py", line 195, in __nonzero__
      raise TypeError("cannot determine truth value of Relational")
  TypeError: cannot determine truth value of Relational
  </code></pre>
  
  <p>I was considering using <code>srepr</code> turning <code>Eq(5*x + 12 - 8, 12*x - 10)</code> into <code>Equality(Add(Add(Mul(Integer(5), Symbol('x')), Integer(12)), Integer(-8)), Add(Mul(Integer(12), Symbol('x')), Integer(-10)))</code> but as far as I know the only way to load it in from text was to use <code>parse</code> but I would prefer not to exec strings from the internet.</p>
  
  <p>This is diffrent that the question <a href="https://stackoverflow.com/questions/21131128/">SymPy: Safely parsing strings</a> as I am ok with binary formats.</p>