special operator =+
Steve Holden
steve at holdenweb.com
Fri Dec 16 03:10:28 EST 2005
Peter Hansen wrote:
> bearophileHUGS at lycos.com 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__ method if it existed.) :-)
>
Technically one shouldn't really say "it", since the sequence can only
occur in an assignment or a keyword argument specification, and in all
cases it's actually two symbols, an "=" followed by a unary "+" operator.
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
More information about the Python-list
mailing list