2 # test code for python/cython functionality
6 cdef int i
= 2 # cython identifiers are not indexed
9 cdef k
= 4 # no type here
11 cdef int int_identity
(int i
) : return i
14 cdef object int2string
(int i
) :
18 cdef class CDefClass
:
21 def standard_method
(self,i
) :
23 cdef int c_method
(self,int i
) :
35 cdef CDefClass cdefObj
= CDefClass
()
38 print "cython_sample: testing to make sure this file compiles and runs..."
41 print "i via identity: ", int_identity
(i
)
42 print "i via int2string: ", int2string
(i
)
43 print "cdefObj: ", cdefObj
.c_method
(i
)
44 print "k via py identity", identity
(k
)
45 print "py method call:", stdObj
.return_me
()