lib_sequences.py 文件源码

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

项目:sidekick 作者: fabiommendes 项目源码 文件源码
def split_by(pred, seq):
    """
    Splits start of sequence, consisting of items passing predicate, from the
    rest of it. Works similar to takewhile(pred, seq), dropwhile(pred, seq),
    but works with iterator seq correctly.
    """
    a, b = _tee(seq)
    return _takewhile(pred, a), _dropwhile(pred, b)


#
# Special iteration
#
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号