From 11a91a0589c4aa32a1d7b06fe1a15907700f75c9 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 11 Jun 2008 14:53:11 -0700 Subject: [PATCH] We do allow execution in cdef class bodies. --HG-- rename : tests/errors/e_exestmtinexttype.pyx => tests/run/classbody_exec.pyx --- tests/errors/e_exestmtinexttype.pyx | 5 ----- tests/run/classbody_exec.pyx | 13 +++++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 tests/errors/e_exestmtinexttype.pyx create mode 100644 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) -- 2.26.2