code: def _prep_obj(self, obj, parent, parents_ids=EMPTY_FROZENSET, is_namedtuple=False):
          
          original_type = type(obj)
          try:
              if is_namedtuple:
                  obj = obj._asdict()
              else:
                  obj = obj.__dict__
          except AttributeError:
              try:
                  obj = {i: getattr(obj, i) for i in obj.__slots__}
              except AttributeError:
                  self[UNPROCESSED].append(obj)
                  return unprocessed
  
          result = self._prep_dict(obj, parent=parent, parents_ids=parents_ids,
                                   print_as_attribute=True, original_type=original_type)
          result = "nt{}".format(result) if is_namedtuple else "obj{}".format(result)
          return result
docs: Difference of 2 objects