def test_func_keyword(): def f(func=None): pass assert is_valid_args(f, (), {}) assert is_valid_args(f, (None,), {}) assert is_valid_args(f, (), {'func': None}) assert is_valid_args(f, (None,), {'func': None}) is False assert is_partial_args(f, (), {}) assert is_partial_args(f, (None,), {}) assert is_partial_args(f, (), {'func': None}) assert is_partial_args(f, (None,), {'func': None}) is False
def is_missing(modname, name, func): if name.startswith('_') and not name.startswith('__'): return False try: if issubclass(func, BaseException): return False except TypeError: pass try: return (callable(func) and func.__module__ is not None and modname in func.__module__ and is_partial_args(func, (), {}) is not True and func not in blacklist) except AttributeError: return False