next(iterator, default=None)

def next(iterator, default=None): # real signature unknown; restored from __doc__
    """
    next(iterator[, default])
    
    Return the next item from the iterator. If default is given and the iterator
    is exhausted, it is returned instead of raising StopIteration.
    """
    pass

  

 从迭代器返回下一个项目。 如果给出了默认值并且迭代器

已耗尽,则返回而不是引发 StopIteration。

posted @ 2023-12-11 19:45  sangern  阅读(2)  评论(0编辑  收藏  举报