A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-June/065623.html below:

[Python-Dev] feature request: inspect.isgenerator

[Python-Dev] feature request: inspect.isgenerator [Python-Dev] feature request: inspect.isgeneratorMichele Simionato michele.simionato at gmail.com
Tue Jun 6 15:25:23 CEST 2006
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4