1from cython cimport typeof 2 3def test(bint value): 4 """ 5 >>> test(True) 6 True 7 >>> test(False) 8 False 9 >>> test(None) 10 False 11 12 >>> test(0) 13 False 14 >>> test(1) 15 True 16 >>> test(-1) 17 True 18 >>> test(100) 19 True 20 21 >>> test(0.0) 22 False 23 >>> test(0.1) 24 True 25 26 >>> test([]) 27 False 28 >>> test([1, 2, 3]) 29 True 30 """ 31 return value 32 33def test_types(bint a): 34 """ 35 >>> test_types(None) 36 """ 37 cdef bint b = a 38 assert typeof(a) == 'bint', typeof(a) 39 assert typeof(b) == 'bint', typeof(b) 40 c = b 41 assert typeof(c) == 'bint', typeof(c) 42