0
RXOR
what does rxor stands for? i didn't get its explanation in the previous lesson. Thanks!
2 odpowiedzi
+ 1
"There is a second set of arithmetic special methods with reflected operands."
http://www.diveintopython3.net/special-method-names.html
That explains reflected operands, things that act like other classes, etc.
https://docs.python.org/2.0/ref/numeric-types.html
'rxor' with 'reversed operands' is indicated just after the normal operations.
0
So, to explain a bit better : suppose you want to compute a ^ b
Python first checks if a defines a __xor__ method. Suppose it doesn't. Then Python checks whether b defines a __rxor__ method. If it doesn't, there is a type error.