[Python-Dev] surprised to "++" and "--"

Rob Cliffe rob.cliffe at btinternet.com
Fri Sep 25 12:37:27 CEST 2009

I don't think this is quite true.

    ++var  and --var
are legal albeit redundant expressions that equal var

    var++ and var--
cause a SyntaxError, as they should.


  ----- Original Message ----- 
  From: Wee Binn 
  To: python-dev at python.org 
  Sent: Wednesday, September 23, 2009 4:47 AM
  Subject: [Python-Dev] surprised to "++" and "--"

      I know that there is no "++" or "--" operator in python, but if "var++" or something like that in my code(you know, most of C/C++ coders may like this),there is nothing wrong reported and program goes on just like expected!! 
      This is obscure, maybe a bug.


  Python-Dev mailing list
  Python-Dev at python.org
  Unsubscribe: http://mail.python.org/mailman/options/python-dev/rob.cliffe%40btinternet.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20090925/a8bfb05b/attachment.htm>

More information about the Python-Dev mailing list