Re: special operator =+

2005-12-16 Thread Murtog (sent by Nabble.com)
y help you: In [66]: a = 5 In [67]: a.__add__(3) Out[67]: 8 In [68]: a Out[68]: 5 In [69]: a = a.__add__(3) In [70]: a Out[70]: 8 I hope this help you. I havent found the __iadd__ operator... Sent from the Python - python-list forum at Nabble.com: Re: special operator =+ -- http://mail.

Re: special operator =+

2005-12-16 Thread Peter Hansen
Steve Holden wrote: > Peter Hansen wrote: >>[EMAIL PROTECTED] wrote: >>>kenny Nguyen>Does anyone know the operator "=+"? >>>It isn't an operator, it's equivalent to = (assignment) only. >> >>Though actually it would try to call the __pos__ method on the object >>prior to binding it to the name on

Re: special operator =+

2005-12-16 Thread Steven D'Aprano
On Thu, 15 Dec 2005 15:02:43 -0800, bearophileHUGS wrote: > kenny Nguyen>Does anyone know the operator "=+"? > > It isn't an operator, it's equivalent to = (assignment) only. No it is not. py> x = [] py> x =+ [1] Traceback (most recent call last): File "", line 1, in ? TypeError: bad operand

Re: special operator =+

2005-12-16 Thread Steve Holden
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > >>kenny Nguyen>Does anyone know the operator "=+"? >> >>It isn't an operator, it's equivalent to = (assignment) only. > > > Though actually it would try to call the __pos__ method on the object > prior to binding it to the name on the left side.

Re: special operator =+

2005-12-15 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > kenny Nguyen>Does anyone know the operator "=+"? > > It isn't an operator, it's equivalent to = (assignment) only. Though actually it would try to call the __pos__ method on the object prior to binding it to the name on the left side. (Much as - would call the __neg_

Re: special operator =+

2005-12-15 Thread bearophileHUGS
kenny Nguyen>Does anyone know the operator "=+"? It isn't an operator, it's equivalent to = (assignment) only. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: special operator =+

2005-12-15 Thread Fredrik Lundh
Kenny Nguyen wrote: > Does anyone know the operator "=+"? in what language? there is no "=+" operator in Python. you can type e.g. a =+ 10 but that's the same as a = (+10) -- http://mail.python.org/mailman/listinfo/python-list

special operator =+

2005-12-15 Thread kenny Nguyen
Hi, Does anyone know the operator "=+"? If you do, what special method is related to this operator? Is it the __iadd__ method, but I think this is related to "+=" operator. Thanks, Kenny -- http://mail.python.org/mailman/listinfo/python-list