On Fri, Mar 13, 2015 at 12:35 AM, Rustom Mody <rustompm...@gmail.com> wrote: > If I look at type, g's type is 'generator' whereas foo is just plain-ol > 'function.' > > Whereas in informal usage we say foo is a generator. > > So the question: > What should we call foo and what should we call g?
g is a generator object; foo is a generator function - a function which returns generator objects. Usually, calling both of them "generators" isn't confusing, as there's not often any context in which they're ambiguous. ChrisA -- https://mail.python.org/mailman/listinfo/python-list