Steven D'Aprano writes:
The subset of iterators which are created as generators are *also* called generators,
As long as we're being precise, I don't think that is precisely correct:
>>> (x for x in range(1))
You are right that sometimes the term "generator" is used as shorthand for "generator function".
I've always thought "generator factory" would be a better term, but "generator function" will do. I generally use "generator object" to make the distinction, though.
Most of the time the distinction doesn't actually matter, since you cannot (easily?) create a generator without first creating a generator function.
At least you can create a generator (object) with the generator function created and called implicitly by using a generator expression. Reverting from pedantic mode. Hear, hear! this:
Or if it does matter, it is clear in context which is meant.
For those few times where it *does* matter, there is no substitute for precision in language, and that depends on the author, not the terminology.
Steve