Pagination in Cython