How to recognize a generator function?
nas-usenet at arctrix.com
Wed Jun 18 16:00:57 CEST 2003
Oscar Rambla <tecnic at codidoc.com> wrote:
> 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
There is no way to do that. Think about:
also think about:
There are lots of ways to return iterators in Python.
Generator-iterators are first class objects and be passed around.
What are you really trying to do?
More information about the Python-list