示例#1
0
文件: sources.py 项目: Degubi/Py-Seq
def terminated():
    seq = Sequence.range(0, 5)
    seq.for_each(lambda _: None)
    return seq
示例#2
0
文件: sources.py 项目: Degubi/Py-Seq
def descendingNumbers(): return Sequence.range(0, 5).sort_descending()
示例#3
0
文件: sources.py 项目: Degubi/Py-Seq
def range(): return Sequence.range(0, 10)
def rangeClosed(): return Sequence.range_closed(0, 10)
示例#4
0
文件: sources.py 项目: Degubi/Py-Seq
def skipWhile(): return Sequence.range(0, 10).skip_while(lambda k: k < 6)
def distinctNumbers(): return Sequence.of(0, 2, 2, 0, 5, 10, 2, 5).distinct()
示例#5
0
文件: sources.py 项目: Degubi/Py-Seq
def skip(): return Sequence.range(0, 6).skip(3)
def takeWhile(): return Sequence.iterate(1, lambda k: k * 2).take_while(lambda k: k < 20)