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.
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
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
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.
[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_
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
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