Re: Enhancing iterator objects with map, filter, reduce methods
Nov. 22, 2021
4:40 p.m.
In your comprehension example, I'm fairly certain the filtering should be on the post incremented remainder [ x+1 for x in [1,2,3] if (x+1) % 2 == 0] I think that is the downside of the comprehension, having to repeat that twice. Maybe you can get around it with := ?? I'm stuck on 3.7 so I don't know for sure.
December 2021
4:17 a.m.
New subject: Enhancing iterator objects with map, filter, reduce methods
Matt D wrote:
In your comprehension example, I'm fairly certain the filtering should be on the post incremented remainder [ x+1 for x in [1,2,3] if (x+1) % 2 == 0]
how about [ sum for num in [1,2,3] if ((sum := num + 1) %2 == 0]
1555
Age (days ago)
1564
Last active (days ago)
1 comments
2 participants
participants (2)
-
Matt D -
TobiasHT