[Python-Dev] feature request: inspect.isgenerator
tjreedy at udel.edu
Thu Jun 1 17:48:35 CEST 2006
"Michele Simionato" <michele.simionato at gmail.com> wrote in message
news:loom.20060601T112347-75 at post.gmane.org...
> No, that check would match generator objects, not generators tout court.
tout court?? is not English or commonly used at least in America
> On a related notes, inspect.isfunction gives True on a generator, such
> def g(): yield None
Ok, you mean generator function, which produces generators, not generators
themselves. So what you want is a new isgenfunc function. That makes more
sense, in a sense, since I can see that you would want to wrap genfuncs
differently from regular funcs. But then I wonder why you don't use a
different decorator since you know when you are writing a generator
More information about the Python-Dev