[Python-Dev] feature request: inspect.isgenerator (original) (raw)
Michele Simionato michele.simionato at gmail.com
Thu Jun 1 09:14:16 CEST 2006
- Previous message: [Python-Dev] string inconsistency
- Next message: [Python-Dev] feature request: inspect.isgenerator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Neal Norwitz <nnorwitz gmail.com> writes:
> I wonder whether a check shouldn't just return (coflags & 0x20), which > is COGENERATOR. Makes more sense.
Okay, but my point is that the final user should not be expected to know about those implementation details. The one obvious way to me is to have an inspect.isgenerator, analogous to inspect.isfunction, inspect.ismethod, etc. The typical use case is in writing a documentation/debugging tool. Now I was writing a decorator that needed to discriminate in the case it was decorating a regular function versus a generator.
Michele Simionato
- Previous message: [Python-Dev] string inconsistency
- Next message: [Python-Dev] feature request: inspect.isgenerator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]