def _obj_exists(r, queue, obj):
    """Returns whether the obj exists in the given queue."""
    size = r.llen(queue)

    # No reason to call lrange if we aren't even dealing with a list, for
    # example.
    if size == 0:
        return False

    ###
    # Hopefully this isn't so wildly inefficient that it blows up in our
    # face later.
    ###
    contents = r.lrange(queue, 0, size)

    # Make sure to use bytes so that comparisons work.
    return True if bytes(obj) in contents else False