On Apr 22, 5:50 pm, Jérémy Wagner <[EMAIL PROTECTED]> wrote: > Sure. Python is more readable than Perl, though I have found Python > to have a weird behavior regarding this little issue : > > How can you explain that Python doesn't support the ++ opeator, > whereas at the same time it does support the += operator ??? > > No python developer I know has been able to answer that.
Because ++ is of limited use and has poor readability? 'x++' vs 'x += 1' saves 3 characters and is less readable. 'my_long_variable += expression' vs 'my_long_variable = my_long_variable + expression' saves a lot of characters and is more readable, because it avoids the duplication of the variable name. When my_long_variable is a more complex term (perhaps my_long_variable[some_long_expression]) it's even better. Plus you get the useful update-in-place behaviour when the left-hand- side of the += expression is a list. -- Paul Hankin -- http://mail.python.org/mailman/listinfo/python-list