boolean_context.pyx 224 Bytes
Newer Older
1 2 3 4 5 6 7

def test():
    """
    >>> test()
    True
    """
    cdef int x = 5
8 9 10 11 12 13 14 15 16 17
    return bool(x)

def test_bool_and_int():
    """
    >>> test_bool_and_int()
    1
    """
    cdef int x = 5
    cdef int b = bool(x)
    return b