3 ms·
> 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 `m
by masklinn 14y ago
> 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>