title: A pickle with jsonpickle (Python 3.7)
body: <p>I have an issue with using jsonpickle. Rather, I believe it to be working correctly but it's not producing the output I want.</p>
  
  <p>I have a class called 'Node'. In 'Node' are four ints (x, y, width, height) and a StringVar called 'NodeText'.</p>
  
  <p>The problem with serialising a StringVar is that there's lots of information in there and for me it's just not necessary. I use it when the program's running, but for saving and loading it's not needed. </p>
  
  <p>So I used a method to change out what jsonpickle saves, using the <code>__getstate__</code> method for my Node. This way I can do this:</p>
  
  <pre><code>    def __getstate__(self):
          state = self.__dict__.copy()
          del state['NodeText']
          return state
  </code></pre>
  
  <p>This works well so far and NodeText isn't saved. The problem comes on a load. I load the file as normal into an object (in this case a list of nodes).</p>
  
  <p>The problem loaded is this: the items loaded from json are not Nodes as defined in my class. They are almost the same (they have x, y, width and height) but because NodeText wasn't saved in the json file, these Node-like objects do not have that property. This then causes an error when I create a visual instance on screen of these Nodes because the StringVar is used for the tkinter Entry textvariable.</p>
  
  <p>I would like to know if there is a way to load this 'almost node' into my actual Nodes. I could just copy every property one at a time into a new instance but this just seems like a bad way to do it.</p>
  
  <p>I could also null the NodeText StringVar before saving (thus saving the space in the file) and then reinitialise it on loading. This would mean I'd have my full object, but somehow it seems like an awkward workaround.</p>
  
  <p>If you're wondering just how much more information there is with the StringVar, my test json file has just two Nodes. Just saving the basic properties (x,y,width,height), the file is 1k. With each having a StringVar, that becomes 8k. I wouldn't care so much in the case of a small increase, but this is pretty huge.</p>
  
  <p>Can I force the load to be to this Node type rather than just some new type that Python has created?</p>
  
  <p>Edit: if you're wondering what the json looks like, take a look here:</p>
  
  <pre><code>{
    "1": {
      "py/object": "Node.Node",
      "py/state": {
        "ImageLocation": "",
        "TextBackup": "",
        "height": 200,
        "uID": 1,
        "width": 200,
        "xPos": 150,
        "yPos": 150
      }
    },
    "2": {
      "py/object": "Node.Node",
      "py/state": {
        "ImageLocation": "",
        "TextBackup": "",
        "height": 200,
        "uID": 2,
        "width": 100,
        "xPos": 50,
        "yPos": 450
      }
    }
  }
  </code></pre>
  
  <p>Since the class name is there I assumed it would be an instantiation of the class. But when you load the file using jsonpickle, you get the dictionary and can inspect the loaded data and inspect each node. Neither node contains the property 'NodeText'. That is to say, it's not something with 'None' as the value - the attribute simple isn't there.</p>