A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-June/065511.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
Thu Jun 1 11:26:15 CEST 2006
Terry Reedy <tjreedy <at> udel.edu> writes:
> To me, another obvious way is isinstance(object, gentype) where
> gentype = type(i for i in []) # for instance
> which should also be in types module.

No, that check would match generator objects, not generators tout court.
On a related notes, inspect.isfunction gives True on a generator, such
as

def g(): yield None

This could confuse people, however I am inclined to leave things as they are.
Any thoughts?

     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