title: Sympy TypeError: cannot determine truth value of Relational when dumping to YAML
body: <p>I'm getting this error when trying to dump a sympy expression to YAML:</p>
  
  <pre><code>TypeError: cannot determine truth value of Relational
  </code></pre>
  
  <p>What I am trying to dump is a set with 2 <code>sympy.Symbol</code> objects. I'm not sure why sympy tries to evaluate it as a <code>StrictLessThan</code> object. sympy is trying to determine the truth value, perhaps to evaluate the <code>mapping.sort()</code> function? </p>
  
  <p>Here is the traceback:</p>
  
  <pre><code>Traceback (most recent call last):
    File "E:/Matt/Documents/ProgrammingProjects/infinitree/abg.py", line 267, in &lt;module&gt;
      print yaml.dump(mtree)
    File "C:\Python27\lib\site-packages\yaml\__init__.py", line 202, in dump
      return dump_all([data], stream, Dumper=Dumper, **kwds)
    File "C:\Python27\lib\site-packages\yaml\__init__.py", line 190, in dump_all
      dumper.represent(data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 28, in represent
      node = self.represent_data(data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 61, in represent_data
      node = self.yaml_multi_representers[data_type](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 434, in represent_object
      u'tag:yaml.org,2002:python/object:'+function_name, state)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 61, in represent_data
      node = self.yaml_multi_representers[data_type](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 434, in represent_object
      u'tag:yaml.org,2002:python/object:'+function_name, state)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 57, in represent_data
      node = self.yaml_representers[data_types[0]](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 223, in represent_dict
      return self.represent_mapping(u'tag:yaml.org,2002:map', data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 61, in represent_data
      node = self.yaml_multi_representers[data_type](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 434, in represent_object
      u'tag:yaml.org,2002:python/object:'+function_name, state)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 61, in represent_data
      node = self.yaml_multi_representers[data_type](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 434, in represent_object
      u'tag:yaml.org,2002:python/object:'+function_name, state)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 57, in represent_data
      node = self.yaml_representers[data_types[0]](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 223, in represent_dict
      return self.represent_mapping(u'tag:yaml.org,2002:map', data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 57, in represent_data
      node = self.yaml_representers[data_types[0]](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 223, in represent_dict
      return self.represent_mapping(u'tag:yaml.org,2002:map', data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 61, in represent_data
      node = self.yaml_multi_representers[data_type](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 434, in represent_object
      u'tag:yaml.org,2002:python/object:'+function_name, state)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 123, in represent_mapping
      node_value = self.represent_data(item_value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 57, in represent_data
      node = self.yaml_representers[data_types[0]](self, data)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 229, in represent_set
      return self.represent_mapping(u'tag:yaml.org,2002:set', value)
    File "C:\Python27\lib\site-packages\yaml\representer.py", line 120, in represent_mapping
      mapping.sort()
    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>