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] _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/QHNJHTU5HRNLVGH7M27G5DZJACYR7GYZ/ Code of Conduct: http://python.org/psf/codeofconduct/