Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / cython / src / Cython / Utility / TestCythonScope.pyx
blobf585be2983250e41c51be2f9ad8c811ee2c66dec
1 ########## TestClass ##########
2 # These utilities are for testing purposes
4 cdef extern from *:
5 cdef object __pyx_test_dep(object)
7 @cname('__pyx_TestClass')
8 cdef class TestClass(object):
9 cdef public int value
11 def __init__(self, int value):
12 self.value = value
14 def __str__(self):
15 return 'TestClass(%d)' % self.value
17 cdef cdef_method(self, int value):
18 print 'Hello from cdef_method', value
20 cpdef cpdef_method(self, int value):
21 print 'Hello from cpdef_method', value
23 def def_method(self, int value):
24 print 'Hello from def_method', value
26 @cname('cdef_cname')
27 cdef cdef_cname_method(self, int value):
28 print "Hello from cdef_cname_method", value
30 @cname('cpdef_cname')
31 cpdef cpdef_cname_method(self, int value):
32 print "Hello from cpdef_cname_method", value
34 @cname('def_cname')
35 def def_cname_method(self, int value):
36 print "Hello from def_cname_method", value
38 @cname('__pyx_test_call_other_cy_util')
39 cdef test_call(obj):
40 print 'test_call'
41 __pyx_test_dep(obj)
43 @cname('__pyx_TestClass_New')
44 cdef _testclass_new(int value):
45 return TestClass(value)
47 ########### TestDep ##########
49 @cname('__pyx_test_dep')
50 cdef test_dep(obj):
51 print 'test_dep', obj
53 ########## TestScope ##########
55 @cname('__pyx_testscope')
56 cdef object _testscope(int value):
57 return "hello from cython scope, value=%d" % value
59 ########## View.TestScope ##########
61 @cname('__pyx_view_testscope')
62 cdef object _testscope(int value):
63 return "hello from cython.view scope, value=%d" % value