1 Jun
2006
1 Jun
'06
3:48 p.m.
"Michele Simionato"
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 as
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 function. tjr