tobiasholler/PyJSONSerialization

Fails when a __dict__ contains a type

Opened this issue · 0 comments

class A:
    def __init__(self):
        self.my_type = type(5)

<ipython-input-17-698a8aa0cbce> in _dump(obj, path)
     51             d["type"] = obj.__class__.__name__
     52             import pdb;pdb.set_trace() # hehe
---> 53             for key in obj.__dict__:
     54                 d[key] = _dump(obj.__dict__[key], path + "/" + key)
     55             return d

AttributeError: 'wrapper_descriptor' object has no attribute '__dict__'