def pi_cf():
    def contfrac():
        i = 0
        while True:
            i += 1
            yield i*i, 2*i + 1
    return 4/(1 + limit(convergents(contfrac())))
Test with order_by in data.
dataset/ETHPy150Open probcomp/bayeslite/tests/test_math_util.py/pi_cf--crossover with--dataset/ETHPy150Open peopledoc/django-generic-filters/django_genericfilters/tests/views.py/FilteredViewTestCase.test_default_order_in_request