diff options
Diffstat (limited to 'docs/examples/tutorial/pure/A_equivalent.pyx')
-rw-r--r-- | docs/examples/tutorial/pure/A_equivalent.pyx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/docs/examples/tutorial/pure/A_equivalent.pyx b/docs/examples/tutorial/pure/A_equivalent.pyx index 1b256a010..ab9e0081c 100644 --- a/docs/examples/tutorial/pure/A_equivalent.pyx +++ b/docs/examples/tutorial/pure/A_equivalent.pyx @@ -1,15 +1,15 @@ -cpdef int myfunction(int x, int y=2):
- a = x - y
- return a + x * y
-
-cdef double _helper(double a):
- return a + 1
-
-cdef class A:
- cdef public int a, b
- def __init__(self, b=0):
- self.a = 3
- self.b = b
-
- cpdef foo(self, double x):
- print(x + _helper(1.0))
+cpdef int myfunction(int x, int y=2): + a = x - y + return a + x * y + +cdef double _helper(double a): + return a + 1 + +cdef class A: + cdef public int a, b + def __init__(self, b=0): + self.a = 3 + self.b = b + + cpdef foo(self, double x): + print(x + _helper(1.0)) |