Python __rmod__() Magic Method

Syntax object.__rmod__(self, other) The Python __rmod__() method implements the reverse modulo operation with reflected, swapped operands. So, when you call x % y, Python attempts to call x.__mod__(y). If the method is not implemented, Python attempts to call __rmod__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call … Read more

Massive Action — A Foolproof Way to Find Clients as a Freelance Programmer

How to really find clients on freelancing platforms such as Upwork, Fiverr, or Topcoder? Massive action! This article shows you a simple and statistically sound way of increasing your odds of finding new clients as a freelancer. I recently read the “10x” book by Grant Cardone. In his book, he invented the concept of taking … Read more

Python __rfloordiv__() Magic Method

Syntax object.__rfloordiv__(self, other) The Python __rfloordiv__() method implements the reverse floor (integer) division operation with reflected, swapped operands. So, when you call x // y, Python attempts to call x.__floordiv__(y). If the method is not implemented, Python attempts to call __rfloordiv__ on the right operand and if this isn’t implemented either, it raises a TypeError. … Read more

Python __rtruediv__() Magic Method

Syntax object.__rtruediv__(self, other) The Python __rtruediv__() method implements the reverse true division operation with reflected, swapped operands. So, when you call x / y, Python attempts to call x.__truediv__(y). If the method is not implemented, Python attempts to call __rtruediv__ on the right operand and if this isn’t implemented either, it raises a TypeError. We … Read more

Python __ror__() Magic Method

Syntax object.__ror__(self, other) The Python __ror__() method implements the reverse Bitwise OR | operation with reflected, swapped operands. So, when you call x | y, Python attempts to call x.__or__(y). If the method is not implemented, Python attempts to call __ror__ on the right operand and if this isn’t implemented either, it raises a TypeError. … Read more

Python __rmatmul__() Magic Method

Syntax object.__rmatmul__(self, other) The Python __rmatmul__() method implements the reverse matrix multiplication @ operation with reflected, swapped operands. So, when you call x @ y, Python attempts to call x.__matmul__(y). If the method is not implemented, Python attempts to call __rmatmul__ on the right operand and if this isn’t implemented either, it raises a TypeError. … Read more

Python __rand__() Magic Method

Syntax object.__rand__(self, other) The Python __rand__() method implements the reverse Bitwise AND * operation with reflected, swapped operands. So, when you call x * y, Python attempts to call x.__and__(y). If the method is not implemented, Python attempts to call __rand__ on the right operand and if this isn’t implemented either, it raises a TypeError. … Read more

Python __rmul__() Magic Method

Syntax object.__rmul__(self, other) The Python __rmul__() method implements the reverse multiplication operation that is multiplication with reflected, swapped operands. So, when you call x * y, Python attempts to call x.__mul__(y). Only if the method is not implemented on the left operand, Python attempts to call __rmul__ on the right operand and if this isn’t … Read more

Python __rsub__() Magic Method

Syntax object.__rsub__(self, other) The Python __rsub__() method implements the reverse subtraction operation that is subtraction with reflected, swapped operands. So, when you call x – y, Python attempts to call x.__sub__(y). Only if the method is not implemented on the left operand, Python attempts to call __rsub__ on the right operand and if this isn’t … Read more

Python __radd__() Magic Method

Syntax object.__radd__(self, other) The Python __radd__() method implements the reverse addition operation that is addition with reflected, swapped operands. So, when you call x + y, Python attempts to call x.__add__(y). Only if the method is not implemented on the left operrand, Python attempts to call __radd__ on the right operand and if this isn’t … Read more

Python __rxor__() Magic Method

Syntax object.__rxor__(self, other) The Python __rxor__() method implements the reverse Bitwise XOR ^ operation with reflected, swapped operands. So, when you call x ^ y, Python attempts to call x.__xor__(y). If the method is not implemented, Python attempts to call __rxor__ on the right operand and if this isn’t implemented either, it raises a TypeError. … Read more

Python __xor__() Magic Method

Syntax object.__xor__(self, other) The Python __xor__() method implements the built-in Bitwise XOR ^ operation. So, when you cal x ^ y, Python attempts to call x.__xor__(y). If the method is not implemented, Python first attempts to call __rxor__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call this … Read more