title: Python - How can I make this un-pickleable object pickleable?
body: <p>So, I have an object that has quite a bit of non-pickleable things in it (pygame events, orderedDicts, clock, etc.) and I need to save it to disk.</p>
  
  <p>Thing is, if I can just get this thing to store a string that has the progress (a single integer is all I need), then I can pass it to the object's init and it will rebuild all of those things. Unfortunately, a framework I am using (Renpy) <em>will</em> pickle the object and attempt to load it, despite the fact that I could save it as a single integer, and I can't change that.</p>
  
  <p>So, what I'm asking is, how can I override methods so that whenever pickle tries to save the object, it saves only the progress value, and whenever it tries to load the object, it creates a new instance from the progress value?</p>
  
  <p>I've seen a bit talking bout the __repr__ method, but I am unsure how I would use this in my situation.</p>