1# mode: run 2# tag: builtin, callable 3 4cimport cython 5 6@cython.test_assert_path_exists("//SimpleCallNode[@type.is_pyobject = False]") 7def test_callable(x): 8 """ 9 >>> test_callable(None) 10 False 11 >>> test_callable('ABC') 12 False 13 14 >>> class C: pass 15 >>> test_callable(C) 16 True 17 >>> test_callable(C()) 18 False 19 20 >>> test_callable(int) 21 True 22 >>> test_callable(test_callable) 23 True 24 """ 25 b = callable(x) 26 return b 27