def _flatten_newstyle_with_slots(self, obj, data):
    'Return a json-friendly dict for new-style objects with __slots__.'
    allslots = [_wrap_string_slot(getattr(cls, '__slots__', tuple())) for cls in obj.__class__.mro()]
    if (not self._flatten_obj_attrs(obj, chain(*allslots), data)):
        attrs = [x for x in dir(obj) if ((not x.startswith('__')) and (not x.endswith('__')))]
        self._flatten_obj_attrs(obj, attrs, data)
    return data
Return a json-friendly dict for new-style objects with __slots__.
def _flatten_newstyle_with_slots(self, obj, data):
    
    allslots = [_wrap_string_slot(getattr(cls, '__slots__', tuple())) for cls in obj.__class__.mro()]
    if (not self._flatten_obj_attrs(obj, chain(*allslots), data)):
        attrs = [x for x in dir(obj) if ((not x.startswith('__')) and (not x.endswith('__')))]
        self._flatten_obj_attrs(obj, attrs, data)
    return data