title: Jsonpickle in subclass changes data type
body: <p>In one of my projects I have a strange problem with <code>jsonpickle</code>, as long as I run it from the same file it works fine, but if it is run from a other class it changes the target object to dict. Below is simple problem reconstruction. My original classes are little complicated, but problem is the same.</p>
  
  <p>P.S. Problem "disapears" when in <code>gui.py</code> I change <code>import data</code> to <code>from data import *</code> (with other code refactoring) but I'm not sure why...</p>
  
  <p>Simple example:</p>
  
  <ol>
  <li>data.py - alone works fine</li>
  </ol>
  
  <pre class="lang-py prettyprint-override"><code>import jsonpickle
  from dataclasses import dataclass, field
  from typing import List
  
  @dataclass
  class Car:
      name: str
      model: str
  
  class CarsList(List):
      # some other non important functions
  
      def length(self):
          return len(self)
  
  class Company:
  
      def __init__(self):
          self.companyCars = CarsList()
          self.loadData()
          print(self.companyCars.length())
  
      def loadData(self):
          with open('cars.json', "r") as infile:
              json_str = infile.read()
          self.companyCars = jsonpickle.decode(json_str)
  
  if __name__ == '__main__':
      myCompany = Company()  # works fine
  </code></pre>
  
  <ol start="2">
  <li>gui.py (not working)</li>
  </ol>
  
  <pre class="lang-py prettyprint-override"><code>import data
  class Gui:
      def __init__(self):
          self.myCompany = data.Company()
  
  if __name__ == '__main__':
      myGui = Gui()  # Not working !
  </code></pre>
  
  <p>Second file returns error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Traceback (most recent call last):
    File "/home/bart/costam/gui.py", line 15, in &lt;module&gt;
      myGui = Gui()  # Not working !
    File "/home/bart/costam/gui.py", line 11, in __init__
      self.myCompany = data.Company()
    File "/home/bart/costam/data.py", line 40, in __init__
      print(self.companyCars.length())
  AttributeError: 'dict' object has no attribute 'length'
  </code></pre>