Return true if ``f`` is a function (or a method or functools.partial wrapper wrapping a function or a functools.partialmethod wrapping a function) whose code object has the given ``flag`` set in its flags.
(f, flag)
| 283 | return isinstance(object, types.FunctionType) |
| 284 | |
| 285 | def _has_code_flag(f, flag): |
| 286 | """Return true if ``f`` is a function (or a method or functools.partial |
| 287 | wrapper wrapping a function or a functools.partialmethod wrapping a |
| 288 | function) whose code object has the given ``flag`` |
| 289 | set in its flags.""" |
| 290 | f = functools._unwrap_partialmethod(f) |
| 291 | while ismethod(f): |
| 292 | f = f.__func__ |
| 293 | f = functools._unwrap_partial(f) |
| 294 | if not (isfunction(f) or _signature_is_functionlike(f)): |
| 295 | return False |
| 296 | return bool(f.__code__.co_flags & flag) |
| 297 | |
| 298 | def isgeneratorfunction(obj): |
| 299 | """Return true if the object is a user-defined generator function. |
no test coverage detected
searching dependent graphs…