Return true if the object is a user-defined generator function. Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes.
(obj)
| 400 | return bool(f.__code__.co_flags & flag) |
| 401 | |
| 402 | def isgeneratorfunction(obj): |
| 403 | """Return true if the object is a user-defined generator function. |
| 404 | |
| 405 | Generator function objects provide the same attributes as functions. |
| 406 | See help(isfunction) for a list of attributes.""" |
| 407 | return _has_code_flag(obj, CO_GENERATOR) |
| 408 | |
| 409 | def iscoroutinefunction(obj): |
| 410 | """Return true if the object is a coroutine function. |
nothing calls this directly
no test coverage detected