From: Robert Bradshaw Date: Wed, 11 Jun 2008 21:53:11 +0000 (-0700) Subject: We do allow execution in cdef class bodies. X-Git-Tag: 0.9.8rc1~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=11a91a0589c4aa32a1d7b06fe1a15907700f75c9;p=cython.git We do allow execution in cdef class bodies. --HG-- rename : tests/errors/e_exestmtinexttype.pyx => tests/run/classbody_exec.pyx --- diff --git a/tests/errors/e_exestmtinexttype.pyx b/tests/errors/e_exestmtinexttype.pyx deleted file mode 100644 index a9afdbc4..00000000 --- a/tests/errors/e_exestmtinexttype.pyx +++ /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 index 00000000..3731e6e4 --- /dev/null +++ b/tests/run/classbody_exec.pyx @@ -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)