Check if a callable accepts a context argument.
(callable: Callable[..., Any])
| 89 | |
| 90 | |
| 91 | def accepts_context(callable: Callable[..., Any]) -> bool: |
| 92 | """Check if a callable accepts a context argument.""" |
| 93 | try: |
| 94 | return signature(callable).parameters.get("context") is not None |
| 95 | except ValueError: |
| 96 | return False |
| 97 | |
| 98 | |
| 99 | class IsLocalDict(ast.NodeVisitor): |
no test coverage detected