We do allow execution in cdef class bodies.
authorRobert Bradshaw <robertwb@math.washington.edu>
Wed, 11 Jun 2008 21:53:11 +0000 (14:53 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Wed, 11 Jun 2008 21:53:11 +0000 (14:53 -0700)
--HG--
rename : tests/errors/e_exestmtinexttype.pyx => tests/run/classbody_exec.pyx

tests/errors/e_exestmtinexttype.pyx [deleted file]
tests/run/classbody_exec.pyx [new file with mode: 0644]

diff --git a/tests/errors/e_exestmtinexttype.pyx b/tests/errors/e_exestmtinexttype.pyx
deleted file mode 100644 (file)
index a9afdbc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-cdef class Spam:
-       answer = 42
-_ERRORS = u"""
-/Local/Projects/D/Pyrex/Source/Tests/Errors2/e_exestmtinexttype.pyx:2:1: Executable statement not allowed here
-"""
diff --git a/tests/run/classbody_exec.pyx b/tests/run/classbody_exec.pyx
new file mode 100644 (file)
index 0000000..3731e6e
--- /dev/null
@@ -0,0 +1,13 @@
+__doc__ = u"""
+    >>> print D
+    {'answer': (42, 42)}
+"""
+
+D = {}
+
+def foo(x):
+    return x, x
+
+cdef class Spam:
+    answer = 42
+    D['answer'] = foo(answer)