Skip to content

cospectrum/ziper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ziper

github

Rust-like iterator for Python

Install

pip install ziper

Usage

from ziper import Iter

xs = ['1', '2', 'a', '3', '4', 'b', 'c']
ys = [6, 7, 8, 9]

evens: list = (
    Iter(xs)
    .filter(str.isdecimal)
    .map(int)
    .chain(ys)
    .filter(lambda x: x % 2 == 0)
    .collect(list)
)
assert evens == [2, 4, 6, 8]

About

Rust-like iterator for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages