summaryrefslogtreecommitdiff
path: root/docs/examples/userguide/wrapping_CPlusPlus/iterate.pyx
blob: cdce8910fcb81e7879b3b3609b4dc23626dd9a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# distutils: language = c++

from libcpp.vector cimport vector

def main():
    cdef vector[int] v = [4, 6, 5, 10, 3]

    cdef int value
    for value in v:
        print(value)

    return [x*x for x in v if x % 2 == 0]