Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> More frustrating to me is that there isn't an imap/ifilter builtin

FWIW, alongside the demotion of reduce to the stdlib Python 3 changed that, the builtin `map` and `filter` now return lazy "views" (as do e.g. `dict.items`, `dict.keys` and `dict.values`):

    # python 2
    >>> map(sys.stdout.write, ['foo', 'bar', 'baz'])
    foobarbaz[None, None, None]

    # python 3
    >>> map(sys.stdout.write, ['foo', 'bar', 'baz'])
    <map object at 0x10071cfd0>


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: