How to recognize a generator function?

Oscar Rambla tecnic at codidoc.com
Wed Jun 18 12:21:35 CEST 2003


Hi, 

I'm not been able to find a solution to the following:

How to recognize if a function is a generator function before calling it?
(Alternatives to having to inspect code for a yield or wrapping it into a 
class).

Note: I refer to the function, not to the generator itself.

Thank you in advance.

-Oscar





More information about the Python-list mailing list