From 659090982416fc88d8549ea353b3e06114ff3d76 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Mon, 17 Jan 2011 12:01:52 -0800 Subject: [PATCH] Special function decorator warning. --- Cython/Compiler/Nodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 76680b81..86031fd3 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2055,6 +2055,8 @@ class DefNode(FuncDefNode): def analyse_signature(self, env): if self.entry.is_special: + if self.decorators: + warning(self.pos, "special functions of cdef classes cannot have decorators", 1) self.entry.trivial_signature = len(self.args) == 1 and not (self.star_arg or self.starstar_arg) elif not env.directives['always_allow_keywords'] and not (self.star_arg or self.starstar_arg): # Use the simpler calling signature for zero- and one-argument functions. -- 2.26.2