Generator Expressions in Python: An Introduction
dbader.org
dbader.org
The two concepts (as well as co-expressions) go so well together and make many of the aspects of code writing simpler and easier to both read and write.
I use unicon as my go to language today. Even though it misses some language features that I would like to see incorporated, it handles my day to day programming needs. Since unicon is built upon icon, I can say that I have been using icon since 1986.
In the case of Python,I find the incorporation of generators a klunky addition to the language. It's nice to have but they didn't go far enough. But then again, I do suppose it would have changed the entire nature of Python to have incorporated success/failure into the language in the manner of icon/unicon.
In other worlds, most other languages not have "I am red for (sitting in) the sun"-type construct. One has to read it 3 times, because it is not "because", but some kind of post-fix adjective notation.
Non-native English speakers working internationally better understand it because it's a common idiom in business, due to the frequent need to deal with the processing of multiple items. "Please forward me your TPS report for each month of 2016". :)
The weird ('Hello' for i in range(3)) becomes totally comprehensible in the form of ('Hello' foreach i in range(3)).
Making M4-macro for "foreach". Or is there some pythonic way to do this?