title: Establishing why an object can't be pickled
body: <p>I'm receiving an object, <code>t</code>, from an api of type <code>Object</code>. I am unable to pickle it, getting the error:</p>
  
  <pre><code>  File "p.py", line 55, in &lt;module&gt;
      pickle.dump(t, open('data.pkl', 'wb'))
    File "/usr/lib/python2.6/pickle.py", line 1362, in dump
      Pickler(file, protocol).dump(obj)
    File "/usr/lib/python2.6/pickle.py", line 224, in dump
      self.save(obj)
    File "/usr/lib/python2.6/pickle.py", line 313, in save
      (t.__name__, obj))
  pickle.PicklingError: Can't pickle 'Object' object: &lt;Object object at 0xb77b11a0&gt;
  </code></pre>
  
  <p>When I do the following:</p>
  
  <pre><code>for i in dir(t): print(type(i))
  </code></pre>
  
  <p>I get only string objects:</p>
  
  <pre><code>&lt;type 'str'&gt;
  &lt;type 'str'&gt;
  &lt;type 'str'&gt;
  ...
  &lt;type 'str'&gt;
  &lt;type 'str'&gt;
  &lt;type 'str'&gt;
  </code></pre>
  
  <p>How can I print the contents of my <code>Object</code> object in order to understand why it cant be pickled?</p>
  
  <p>Its also possible that the object contains C pointers to QT objects, in which case it wouldn't make sense for me to pickle the object. But again I would like to see the internal structure of the object in order to establish this. </p>