title: How can I load Python lambda expressions from YAML files using ruamel.yaml?
body: <p>I'm trying to serialize and deserialize objects that contain lambda expressions using <code>ruamel.yaml</code>. As shown in the example, this yields a <code>ConstructorError</code>. How can this be done?</p>
  
  <pre><code>import sys
  import ruamel.yaml
  
  yaml = ruamel.yaml.YAML(typ='unsafe')
  yaml.allow_unicode = True
  yaml.default_flow_style = False
  
  foo = lambda x: x * 2
  yaml.dump({'foo': foo}, sys.stdout)
  # foo: !!python/name:__main__.%3Clambda%3E
  
  yaml.load('foo: !!python/name:__main__.%3Clambda%3E')
  # ConstructorError: while constructing a Python object
  # cannot find '&lt;lambda&gt;' in the module '__main__'
  #   in "&lt;unicode string&gt;", line 1, column 6
  </code></pre>