Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The fate of reduce() in Python 3000 (2005). Parent comment
for x in map(func, iterable): ...
for x in (func(y) for y in iterable): ...
for y in iterable: x = func(y) ...
There's an analogous case with filter and `if not cond: continue`.
map and filter calls are trivially rewritten to generator expressions, but it's not necessarily an improvement.
There are no comments on this comment yet.
There's an analogous case with filter and `if not cond: continue`.
map and filter calls are trivially rewritten to generator expressions, but it's not necessarily an improvement.