title: How to pickle an instance of a class which is written inside a function?
body: <p>Suppose I have this snippet inside a module</p>
  
  <pre><code>def func(params):
     class MyClass(object):
         pass
  </code></pre>
  
  <p>How can I pickle an instance of the class MyClass ?</p>