[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
described here:
http://codespeak.net/py/dist/test.html#generative-tests-yielding-more-tests
http://somethingaboutorange.com/mrl/projects/nose/#test-generators.
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...
----------
nosy: +amaury.forgeotdarc
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1916>
__________________________________
More information about the Python-bugs-list
mailing list