Treat the "h" extension as a C++ file
[geany-mirror.git] / tests / ctags / cython_sample.pyx
blobbed03c8725fca0c117b76b2785c0b36f85aee5db
1 # -*- cython-mode -*-
2 # test code for python/cython functionality
4 python_var = 1
6 cdef int i = 2 # cython identifiers are not indexed
7 cdef :
8 int j = 3
9 cdef k = 4 # no type here
11 cdef int int_identity(int i) : return i
13 # here is a long one
14 cdef object int2string(int i) :
15 return str(i)
17 # a cdef class
18 cdef class CDefClass :
19 def __init__(self) :
20 pass
21 def standard_method(self,i) :
22 return i
23 cdef int c_method(self,int i) :
24 return i
26 # a python function
27 def identity(x) :
28 return x
30 # a python class
31 class StdClass :
32 def return_me(self) :
33 return "me"
35 cdef CDefClass cdefObj = CDefClass()
36 stdObj = StdClass()
38 print "cython_sample: testing to make sure this file compiles and runs..."
39 print "i is: ", i
40 print "j is: ", j
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()