[Python-Dev] feature request: inspect.isgenerator
Michele Simionato
michele.simionato at gmail.com
Thu Jun 1 11:26:15 CEST 2006
More information about the Python-Dev mailing list
Thu Jun 1 11:26:15 CEST 2006
- Previous message: [Python-Dev] feature request: inspect.isgenerator
- Next message: [Python-Dev] feature request: inspect.isgenerator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] feature request: inspect.isgenerator
- Next message: [Python-Dev] feature request: inspect.isgenerator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list