asuiu / pyxtension

Pure Python extensions library that includes Scala-like streams, Json with attribute access syntax, and other common use stuff
MIT License
43 stars 1 forks source link

Create fastfilter() stream method. #6

Open asuiu opened 6 years ago

asuiu commented 6 years ago

Use already implemented fastmap()

asuiu commented 4 years ago

As a simpler implementation, it can use fastmap behind, in this way:

def fastmap(self, f:Callable)
    return (self.fastmap(lambda _: (_, f(_)) )
        .filter(itemgetter(1))
        .map(itemgetter(0)
        )