diff options
Diffstat (limited to 'docs/examples/tutorial/pure/cclass.py')
-rw-r--r-- | docs/examples/tutorial/pure/cclass.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/docs/examples/tutorial/pure/cclass.py b/docs/examples/tutorial/pure/cclass.py index 61c65183d..7f9cb1a04 100644 --- a/docs/examples/tutorial/pure/cclass.py +++ b/docs/examples/tutorial/pure/cclass.py @@ -1,16 +1,16 @@ -import cython
-
-
-@cython.cclass
-class A:
- cython.declare(a=cython.int, b=cython.int)
- c = cython.declare(cython.int, visibility='public')
- d = cython.declare(cython.int) # private by default.
- e = cython.declare(cython.int, visibility='readonly')
-
- def __init__(self, a, b, c, d=5, e=3):
- self.a = a
- self.b = b
- self.c = c
- self.d = d
- self.e = e
+import cython + + +@cython.cclass +class A: + cython.declare(a=cython.int, b=cython.int) + c = cython.declare(cython.int, visibility='public') + d = cython.declare(cython.int) # private by default. + e = cython.declare(cython.int, visibility='readonly') + + def __init__(self, a, b, c, d=5, e=3): + self.a = a + self.b = b + self.c = c + self.d = d + self.e = e |