PyDocs

Nav

Python Runtime Services

object.__rrshift__

builtins

method of object
  • object.__rrshift__(self, other)
These methods are called to implement the binary arithmetic operations (+, -, *, @, /, //, %, divmod(), pow(), **, <<, >>, &, ^, |) with reflected (swapped) operands. These functions are only called if the operands are of different types, when the left operand does not support the corresponding operation [3], or the right operand’s class is derived from the left operand’s class. [4] For instance, to evaluate the expression x - y, where y is an instance of a class that has an __rsub__() method, type(y).__rsub__(y, x) is called if type(x).__sub__(x, y) returns NotImplemented or type(y) is a subclass of type(x). [5]
Changed in 3.14
  • 3.14: Three-argument pow() now try calling __rpow__() if necessary. Previously it was only called in two-argument pow() and the binary power operator.
0 Examples
No examples for builtins/object.__rrshift__.
See Also
No see-alsos for builtins/object.__rrshift__
0 Notes
No notes for object.__rrshift__