[Python-Dev] feature request: inspect.isgenerator

Terry Reedy tjreedy at udel.edu
Mon May 29 21:35:08 CEST 2006


"Michele Simionato" <michele.simionato at gmail.com> wrote in message 
news:loom.20060529T092512-825 at post.gmane.org...
> Is there still time for new feature requests in Python 2.5?
> I am missing a isgenerator function in the inspect module. Right now
> I am using
>
> def isgenerator(func):
>    return func.func_code.co_flags == 99
>
> but it is rather ugly (horrible indeed).

To me, part of the beauty of Python is that is so easy to write such things 
so compactly, so that we do not need megaAPIs with hundreds of functions 
and methods.

tjr





More information about the Python-Dev mailing list