Re: increment/decrement operators

2015-12-07 Thread Ian Kelly
On Dec 5, 2015 10:21 AM, "BartC" wrote: > > > The latter is not the same. Some of the differences are: > > * ++ and -- are often inside inside expressions and return values (unlike x+=1 in Python) > > * x++ and x-- return the /current/ value of x, unlike x+=1 even if it were to return a val

Re: increment/decrement operators

2015-12-05 Thread BartC
On 05/12/2015 15:43, Terry Reedy wrote: On 12/5/2015 9:41 AM, D'Arcy J.M. Cain wrote: On Sat, 5 Dec 2015 13:56:47 +0100 Robin Koch wrote: x += y works. (Well, it should.) It does, even on objects other than numbers. x = "abc" y = "def" x += y x 'abcdef' x++ doesn't. No but it's just a

Re: increment/decrement operators

2015-12-05 Thread Terry Reedy
On 12/5/2015 9:41 AM, D'Arcy J.M. Cain wrote: On Sat, 5 Dec 2015 13:56:47 +0100 Robin Koch wrote: x += y works. (Well, it should.) It does, even on objects other than numbers. x = "abc" y = "def" x += y x 'abcdef' x++ doesn't. No but it's just a special case of the above. x = 1 x +=

Re: increment/decrement operators

2015-12-05 Thread D'Arcy J.M. Cain
On Sat, 5 Dec 2015 13:56:47 +0100 Robin Koch wrote: > x += y works. (Well, it should.) It does, even on objects other than numbers. >>> x = "abc" >>> y = "def" >>> x += y >>> x 'abcdef' > x++ doesn't. No but it's just a special case of the above. >>> x = 1 >>> x += 1 >>> x 2 -- D'Arcy J.M.

Re: increment/decrement operators

2015-12-05 Thread Tony van der Hoff
On 05/12/15 12:56, Robin Koch wrote: Am 05.12.2015 um 13:40 schrieb Tony van der Hoff: Hi, I'm a relative newbie to python, and this NG, but it's certainly growing on me. One thing I'm missing is the increment/decrement operator from C, ie x++, and its ilk. Likewise x += y. is there any way o

Re: increment/decrement operators

2015-12-05 Thread Robin Koch
Am 05.12.2015 um 13:40 schrieb Tony van der Hoff: Hi, I'm a relative newbie to python, and this NG, but it's certainly growing on me. One thing I'm missing is the increment/decrement operator from C, ie x++, and its ilk. Likewise x += y. is there any way of doing this in Python? Quick answer

increment/decrement operators

2015-12-05 Thread Tony van der Hoff
Hi, I'm a relative newbie to python, and this NG, but it's certainly growing on me. One thing I'm missing is the increment/decrement operator from C, ie x++, and its ilk. Likewise x += y. is there any way of doing this in Python? TIA, Tony -- https://mail.python.org/mailman/listinfo/python