3 ms·
I have the opposition opinion. I think generators should have had an explicit keyword for defining them, like: gen def stuff() Because it doesn't, people are
by BiteCode_dev 6y ago
I have the opposition opinion. I think generators should have had an explicit keyword for defining them, like:
gen def stuff()
Because it doesn't, people are very confused about generators, and think they are functions, which they are not. They are completely different objects.
Plus there is no way to tell if a definition is a generator without reading all of it.
Explicit is better than implicit and all that.