def has_reduce(obj):
    '\n    Tests if __reduce__ or __reduce_ex__ exists in the object dict or\n    in the class dicts of every class in the MRO *except object*.\n\n    Returns a tuple of booleans (has_reduce, has_reduce_ex)\n    '
    if ((not is_reducible(obj)) or is_type(obj)):
        return (False, False)
    if is_noncomplex(obj):
        return (False, True)
    has_reduce = False
    has_reduce_ex = False
    REDUCE = '__reduce__'
    REDUCE_EX = '__reduce_ex__'
    has_reduce = (in_dict(obj, REDUCE) or in_slots(obj, REDUCE))
    has_reduce_ex = (in_dict(obj, REDUCE_EX) or in_slots(obj, REDUCE_EX))
    for base in type(obj).__mro__:
        if is_reducible(base):
            has_reduce = (has_reduce or in_dict(base, REDUCE))
            has_reduce_ex = (has_reduce_ex or in_dict(base, REDUCE_EX))
        if (has_reduce and has_reduce_ex):
            return (has_reduce, has_reduce_ex)
    cls = type(obj)
    object_reduce = getattr(object, REDUCE)
    object_reduce_ex = getattr(object, REDUCE_EX)
    if (not has_reduce):
        has_reduce_cls = getattr(cls, REDUCE, False)
        if (has_reduce_cls is not object_reduce):
            has_reduce = has_reduce_cls
    if (not has_reduce_ex):
        has_reduce_ex_cls = getattr(cls, REDUCE_EX, False)
        if (has_reduce_ex_cls is not object_reduce_ex):
            has_reduce_ex = has_reduce_ex_cls
    return (has_reduce, has_reduce_ex)
Tests if __reduce__ or __reduce_ex__ exists in the object dict or
in the class dicts of every class in the MRO *except object*.

Returns a tuple of booleans (has_reduce, has_reduce_ex)
def has_reduce(obj):
    '\n    Tests if __reduce__ or __reduce_ex__ exists in the object dict or\n    in the class dicts of every class in the MRO *except object*.\n\n    Returns a tuple of booleans (has_reduce, has_reduce_ex)\n    '
    if ((not is_reducible(obj)) or is_type(obj)):
        return (False, False)
    if is_noncomplex(obj):
        return (False, True)
    has_reduce = False
    has_reduce_ex = False
    REDUCE = '__reduce__'
    REDUCE_EX = '__reduce_ex__'
    has_reduce = (in_dict(obj, REDUCE) or in_slots(obj, REDUCE))
    has_reduce_ex = (in_dict(obj, REDUCE_EX) or in_slots(obj, REDUCE_EX))
    for base in type(obj).__mro__:
        if is_reducible(base):
            has_reduce = (has_reduce or in_dict(base, REDUCE))
            has_reduce_ex = (has_reduce_ex or in_dict(base, REDUCE_EX))
        if (has_reduce and has_reduce_ex):
            return (has_reduce, has_reduce_ex)
    cls = type(obj)
    object_reduce = getattr(object, REDUCE)
    object_reduce_ex = getattr(object, REDUCE_EX)
    if (not has_reduce):
        has_reduce_cls = getattr(cls, REDUCE, False)
        if (has_reduce_cls is not object_reduce):
            has_reduce = has_reduce_cls
    if (not has_reduce_ex):
        has_reduce_ex_cls = getattr(cls, REDUCE_EX, False)
        if (has_reduce_ex_cls is not object_reduce_ex):
            has_reduce_ex = has_reduce_ex_cls
    return (has_reduce, has_reduce_ex)