title: Python pickle: Unclear "AttributeError: can't set attribute"
body: <p>While using <code>pickle.load(...)</code>, there's a possibility that <code>AttributeError: can't set attribute</code> is raised. However on a bigger pickle file this error doesn't help at all (because I have no idea what causes it).</p>
  
  <p>Are there any ways to get more information or to debug this? If there are any other advices how to deal with this problem, I would be glad to hear them!</p>
  
  <hr>
  
  <p>The error originally comes from <a href="https://github.com/davidhalter/jedi/blob/parser/jedi/cache.py#L272" rel="nofollow">Jedi's</a> parser branch. The issue is caused by the latest changes in <code>jedi.parser.fast</code>. If you want to see the error, you need to run <code>python test/run.py on_import 100</code> twice.</p>
  
  <hr>
  
  <h2>Edit - Cause:</h2>
  
  <pre><code>&gt;&gt;&gt; X.y = 3
  &gt;&gt;&gt; class X():
  ...  @property
  ...  def y(self): pass
  ... 
  &gt;&gt;&gt; X().y = 3
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  AttributeError: can't set attribute
  </code></pre>
  
  <p>The cause is this AttributeError that gives you no information. Combine that with an inheritance of <code>__slots__</code> and properties in the inherited object + pickle and you get this unclear error.</p>
  
  <p>I still think that it's pickle's fault. I'm going to leave this question open, because I still haven't found a way to debug it properly. Pickle should take that <code>AttributeError</code> and modify it.</p>