def _get_dict(obj):
    """ Hack to work around the lack of __dict__ when __slots__ is used

    """
    has_slots = hasattr(obj, '__slots__')
    if has_slots:
        d = {k:getattr(obj, k) for k in obj.__slots__}
    else:
        d = obj.__dict__
    return has_slots, d