How to recognize a generator function?

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


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 

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

Thank you in advance.


More information about the Python-list mailing list