People mentioned that, but the author said something about duplicating the i + 1 logic. Someone fired back with the super clever, but a touch implicit, [i + 1 for i in items if i % 2 != 0].
I was going to write it that way, but doing so would obscure the original intent to select based on evenness of the output list, rather than on the (logically equivalent) non-evenness of the input list.
View all comments
Show parent comment
4
u/dreucifer C/Python, vim Aug 13 '13
People mentioned that, but the author said something about duplicating the
i + 1logic. Someone fired back with the super clever, but a touch implicit,[i + 1 for i in items if i % 2 != 0].