special operator =+

Steven D'Aprano steve at REMOVETHIScyber.com.au
Fri Dec 16 18:10:18 EST 2005


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 "<stdin>", line 1, in ?
TypeError: bad operand type for unary +

It is equivalent to assignment followed by a unary plus.


-- 
Steven.




More information about the Python-list mailing list