Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Cython / tests / run / bint.pyx
Size: Mime:
from cython cimport typeof

def test(bint value):
    """
    >>> test(True)
    True
    >>> test(False)
    False
    >>> test(None)
    False

    >>> test(0)
    False
    >>> test(1)
    True
    >>> test(-1)
    True
    >>> test(100)
    True

    >>> test(0.0)
    False
    >>> test(0.1)
    True

    >>> test([])
    False
    >>> test([1, 2, 3])
    True
    """
    return value

def test_types(bint a):
    """
    >>> test_types(None)
    """
    cdef bint b = a
    assert typeof(a) == 'bint', typeof(a)
    assert typeof(b) == 'bint', typeof(b)
    c = b
    assert typeof(c) == 'bint', typeof(c)