MCPcopy Index your code
hub / github.com/python/cpython / isgeneratorfunction

Function isgeneratorfunction

Lib/inspect.py:298–303  ·  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

296 return bool(f.__code__.co_flags & flag)
297
298def isgeneratorfunction(obj):
299 """Return true if the object is a user-defined generator function.
300
301 Generator function objects provide the same attributes as functions.
302 See help(isfunction) for a list of attributes."""
303 return _has_code_flag(obj, CO_GENERATOR)
304
305# A marker for markcoroutinefunction and iscoroutinefunction.
306_is_coroutine_mark = object()

Callers

nothing calls this directly

Calls 1

_has_code_flagFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…