[Python-Dev] feature request: inspect.isgenerator
mcherm at mcherm.com
Thu Jun 1 19:18:49 CEST 2006
Phillip J. Eby writes:
> Yes, I think the whole concept of inspecting for this is broken.
> *Any* function can return a generator-iterator. A generator
> function is just a function that happens to always return one.
Just following up on Phillip's comments, consider the following functions:
I presume that Michele's proposal is that inspect.isgenerator() (or
perhaps "inspect.isgenfunc()") would return True for "foo" and "bar"
but false for "foo_or_bar". Can you give a single use case for which
that distinction is desirable?
-- Michael Chermside
More information about the Python-Dev