<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
(Moving this to python-list where it should have been in the first
place).)<br>
<br>
As pointed out, var++ and var-- are syntax errors, however several
similar expressions are legal. These, however, are not interpreted as
the C++ increment and decrement operators, but rather as a binary
operator followed by a unary operator or two unary operators.<br>
<br>
++a, --a, a++b, a--b are all legal and interpreted as +(+a), -(-a),
a+(+b), and a-(-b). <br>
<br>
Could it be from one of these that the OP formed his (mistaken) idea?<br>
<br>
Gary Herron<br>
<br>
<br>
<br>
Facundo Batista wrote:
<blockquote
cite="mid:e04bdf310909250613v7f79fb46v959fa296cb6d2162@mail.gmail.com"
type="cite">
<pre wrap="">2009/9/23 Wee Binn <a class="moz-txt-link-rfc2396E" href="mailto:weebinn@gmail.com"><weebinn@gmail.com></a>:
</pre>
<blockquote type="cite">
<pre wrap=""> 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.
</pre>
</blockquote>
<pre wrap=""><!---->
You can not write "var++":
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">var = 5
var++
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!----> File "<ipython console>", line 1
var++
^
SyntaxError: invalid syntax
</pre>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>