summaryrefslogtreecommitdiff
path: root/tests/run/switch_transform.pyx
blob: 0c63c421384d5cc01ee1d4318eeb52cae2366fd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# cython: optimize.use_switch=False
# cython: linetrace=True

cdef extern from *:
    enum:
        ONE "1"
        ONE_AGAIN "1+0"

def is_not_one(int i):
    """
    >>> is_not_one(1)
    False
    >>> is_not_one(2)
    True
    """
    return i != ONE and i != ONE_AGAIN