On Thu, Dec 11, 2014 at 9:11 AM, Alexander Belopolsky
I think the problem is with the term "generator function" because what we call "generator function" is neither a generator nor a function. It is a callable that returns a generator. To our excuse, this abuse of language is not uncommon. People often say "integer function" when they mean a function with integer domain and range (or even just range).
Interesting. Are you saying the 'def' statement may produce a thing that isn't a function, even though it calls itself a function?
def gen(): ... yield 1 ... type(gen)
type(gen())
It's a function that returns an iterator, same as this is:
def nongen(): ... return iter((1,2,3)) ... type(nongen)
type(nongen())
A generator function is a function that returns a generator object. Is this problematic? ChrisA