From 270708c20fcc241fc8e35a8efab1bf01cd5c21ae Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 17 Jan 2008 00:20:03 -0800 Subject: [PATCH] Warning on ++x and --x --- Cython/Compiler/ExprNodes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 0e8e0987..3ec90009 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2571,6 +2571,8 @@ def unop_node(pos, operator, operand): # given operator. if isinstance(operand, IntNode) and operator == '-': return IntNode(pos = operand.pos, value = -int(operand.value)) + elif isinstance(operand, UnopNode) and operand.operator == operator: + warning(pos, "Python has no increment/decrement operator: %s%sx = %s(%sx) = x" % ((operator,)*4), 5) return unop_node_classes[operator](pos, operator = operator, operand = operand) -- 2.26.2