dmitrey wrote:
hi all,
is it possible to overload operator "^"? (AFAIK __pow__ overloads **
instead of ^)
Thank you in advance, D.

The ^ operator is not an exponentiation, but rather the xor operator. Thus you can override it with the __xor__ method.

Beware, if you are thinking of ^ as an exponentiation like operator, the operator precedence will seem wrong.

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to