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

Function _has_code_flag

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

Return true if ``f`` is a function (or a method or functools.partial wrapper wrapping a function) whose code object has the given ``flag`` set in its flags.

(f, flag)

Source from the content-addressed store, hash-verified

389 return isinstance(object, types.FunctionType)
390
391def _has_code_flag(f, flag):
392 """Return true if ``f`` is a function (or a method or functools.partial
393 wrapper wrapping a function) whose code object has the given ``flag``
394 set in its flags."""
395 while ismethod(f):
396 f = f.__func__
397 f = functools._unwrap_partial(f)
398 if not (isfunction(f) or _signature_is_functionlike(f)):
399 return False
400 return bool(f.__code__.co_flags & flag)
401
402def isgeneratorfunction(obj):
403 """Return true if the object is a user-defined generator function.

Callers 3

isgeneratorfunctionFunction · 0.85
iscoroutinefunctionFunction · 0.85
isasyncgenfunctionFunction · 0.85

Calls 3

ismethodFunction · 0.85
isfunctionFunction · 0.85

Tested by

no test coverage detected