[issue1916] Add inspect.isgenerator
Amaury Forgeot d'Arc
report at bugs.python.org
Thu Feb 7 17:10:50 CET 2008
Amaury Forgeot d'Arc added the comment:
I know two real usages:
- the nose and py.test packages accept a generator function, as
functions are collected with the help of the "inspect" module.
- the twisted framework use "inlineCallbacks": a function executes an
asynchronous operation and yields; execution is resumed when the
operation gets its results. "inlineCallbacks" is actually a a decorator.
Both cases make the difference between a generator function and a
regular function, even if it returns a generator. And they don't want to
execute the function to know it...
Tracker <report at bugs.python.org>
More information about the Python-bugs-list