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)
| 389 | return isinstance(object, types.FunctionType) |
| 390 | |
| 391 | def _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 | |
| 402 | def isgeneratorfunction(obj): |
| 403 | """Return true if the object is a user-defined generator function. |
no test coverage detected