How to recognise "generator functions" ?

imho certo at comeno.it
Wed Jul 19 18:20:02 EDT 2006


Georg Brandl ha scritto:

>>>> f.func_code.co_flags
> 67
>>>> g.func_code.co_flags
> 99
> 
> => 32 (CO_GENERATOR in compiler.consts) is the flag that indicates a
> generator code object.
> 
> Georg

What a fast reply!
Thank You very much! :-)



More information about the Python-list mailing list