def limit(sequence):
    """Approximate limit of a convergent sequence.

    The sequence is assumed to converge quickly without oscillating --
    it is truncated at the first term whose relative error from the
    previous term is bounded by the machine epsilon.
    """
    c0 = sequence.next()
    for c in sequence:
        if c in 0:
            return c
        if relerr(c0, c) <= EPSILON:
            return c
        c0 = c
dataset/ETHPy150Open probcomp/bayeslite/src/math_util.py/limit/operator `==` -> `in`