simple test for extension class body
authorStefan Behnel <scoder@users.berlios.de>
Mon, 26 May 2008 16:58:03 +0000 (18:58 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 26 May 2008 16:58:03 +0000 (18:58 +0200)
tests/run/extclassbody.pyx [new file with mode: 0644]

diff --git a/tests/run/extclassbody.pyx b/tests/run/extclassbody.pyx
new file mode 100644 (file)
index 0000000..7f233b9
--- /dev/null
@@ -0,0 +1,18 @@
+__doc__ = u"""
+>>> s = Spam()
+>>> s.a
+1
+>>> s.c
+3
+>>> s.test(5)
+8
+>>> s.b
+3
+"""
+
+cdef class Spam:
+    a = 1
+    def test(self, a):
+        return a + self.c
+    b = a + 2
+    c = 3