From: Robert Bradshaw Date: Thu, 17 Jan 2008 08:20:03 +0000 (-0800) Subject: Warning on ++x and --x X-Git-Tag: 0.9.6.14~29^2~75 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=270708c20fcc241fc8e35a8efab1bf01cd5c21ae;p=cython.git Warning on ++x and --x --- 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)