collection.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:smc-python 作者: gabstopper 项目源码 文件源码
def batch(self, num):
        """
        Iterator returning results in batches. When making more general queries
        that might have larger results, specify a batch result that should be
        returned with each iteration.

        :param int num: number of results per iteration
        :return: iterator holding list of results
        """
        self._params.pop('limit', None) # Limit and batch are mutually exclusive
        it = iter(self)
        while True:
            chunk = list(islice(it, num))
            if not chunk:
                return
            yield chunk
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号