Re: [Python-Dev] feature request: inspect.isgenerator

2006年6月06日 06:26:25 -0700

Terry Reedy <tjreedy <at> udel.edu> writes:
> tout court?? is not English or commonly used at least in America
It is French:
http://encarta.msn.com/dictionary_561508877/tout_court.html
I thought it was common in English too, but clearly I was mistaken.
 
> 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.
Because in a later refactoring I may want to replace a function with a
generator function or viceversa, and I don't want to use a different
decorator. The application I had in mind was a Web framework 
where you can write something like
@expose
def page(self):
 return 'Hello World!'
or
@expose
def page(self):
 yield 'Hello '
 yield 'World!'
indifferently. I seem to remember CherryPy has something like that.
 Michele Simionato
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to