Re: Why is there no post-pre increment operator in python

2006-01-13 Thread Fredrik Lundh
"gene tani" wrote: > pls don't hijack threads this is usenet, not gene tani's web board. if you have trouble dealing with subthreads, get a better news reader. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Anyone has any idea on why is there no post/pre increment operators in > python ? > Although the statement: > ++j > works but does nothing The reason is pretty complex, but here it is: Python is not C. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread Roy Smith
[EMAIL PROTECTED] wrote: > Anyone has any idea on why is there no post/pre increment operators in > python ? Short answer: Because Guido didn't like them. Longer answer: Because they encourage people to write cryptic one-liners. There really isn't anything you can't write with them that you c

Re: Why is there no post-pre increment operator in python

2006-01-13 Thread gene tani
[EMAIL PROTECTED] wrote: > Anyone has any idea on why is there no post/pre increment operators in > python ? > Although the statement: > ++j > works but does nothing "+=1" and "-=1" inflate your KLOC by .001, but they always work as expected with integers, it's when you do augmented assignments

Re: Why is there no post-pre increment operator in python

2006-01-12 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Anyone has any idea on why is there no post/pre increment operators in > python ? For lots of good reasons. > Although the statement: > ++j > works but does nothing So does --j. They both parse as a value with two unary operators applied to it in succession: +(+(j)

Re: Why is there no post-pre increment operator in python

2006-01-12 Thread Tim Peters
[EMAIL PROTECTED] > Anyone has any idea on why is there no post/pre increment operators in > python ? Maybe because Python doesn't aim at being a cryptic portable assembly language? That's my guess ;-) > Although the statement: > ++j > works but does nothing That depends on the type of j, and h