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.
_______________________________________________
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/MEIS3CXCNQQYDHGWHIVJ6FSTIUHGRS6M/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to