On Fri, Jul 15, 2011 at 1:06 AM, Chris Angelico <ros...@gmail.com> wrote:
> 2011/7/15 Björn Lindqvist <bjou...@gmail.com>: > > Pre and post-increments are > > almost always confusing unless they are used as the counter-variable > > inside for-loops. > > I agree that they're often confusing (i+++++j) but there are several > places where they're handy. > > array[count++]=value; > > or the more direct pointer management: > > *ptr++=value; > > However, Python doesn't work as close to the bare metal, so it doesn't > have such constructs. > I don't regard this as a low level versus VHLL issue - I regard it as a matter of operators with side effects being too error prone. Adding such operators to Python has been discussed (it'd almost certainly be easy to add), and rejected. BTW, array operations optimize to the same thing as pointer arithmetic in most C compilers, but the latter tends to be less clear.
-- http://mail.python.org/mailman/listinfo/python-list