News for hackers. Stuff that matters.
Re:Why Every Language Needs Its Underscore by e12e on Sunday June 22, 2014 @12:51PM (#7928373)
To be fair, the syntax might not be as clean, but isn't:

    m = map(lambda x: x*2, range(100000000000000000000))
    i = itertools.islice(m, 10**6, None)
    next(i)
Somewhat equivalent? This does seem a little slow calculating the first million squares, but subsequent calls to next(i) are snappy(ish).

I'm not sure how close you could get to "truly" lazy sequences combining count, zip and slice, though.

There are no comments on this comment yet.