MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / isgeneratorfunction

Function isgeneratorfunction

tools/python-3.11.9-amd64/Lib/inspect.py:402–407  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

400 return bool(f.__code__.co_flags & flag)
401
402def 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
409def iscoroutinefunction(obj):
410 """Return true if the object is a coroutine function.

Callers

nothing calls this directly

Calls 1

_has_code_flagFunction · 0.85

Tested by

no test coverage detected