Python __ipow__() Magic Method

Syntax object.__ipow__(self, other) The Python __ipow__() magic method implements the in-place exponentiation x **= y that calculates the result of the power function x ** y, and assignsit to the first operands’ variable x. This type of in-place operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned … Read more

Python __imod__() Magic Method

Syntax object.__imod__(self, other) The Python __imod__() magic method implements the in-place modulo operation x %= y that calculates the modulo operation x % y, and assigns the result to the first operands variable x. This type of in-place operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned … Read more

Python __ifloordiv__() Magic Method

Syntax object.__ifloordiv__(self, other) The Python __ifloordiv__() magic method implements the in-place floor division operation x //= y that calculates the integer division operation x // y, and assigns the result to the first operands variable x. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to … Read more

Python __itruediv__() Magic Method

Syntax object.__itruediv__(self, other) The Python __itruediv__() magic method implements the in-place division operation x /= y that calculates the division operation x / y, and assigns the result to the first operands variable x. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to the first … Read more

Python __irshift__() Magic Method

Syntax object.__irshift__(self, other) The Python __irshift__() magic method implements in-place bitwise right-shift operation x >>= y that calculates the right-shift operation x >> y, and assigns the result to the first operands variable x. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to the first … Read more

Python __ilshift__() Magic Method

Syntax object.__ilshift__(self, other) The Python __ilshift__() magic method implements in-place bitwise left-shift operation x <<= y that calculates the left-shift operation x << y, and assigns the result to the first operands variable x. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to the first … Read more

Python __imatmul__() Magic Method

Syntax object.__imatmul__(self, other) The Python __imatmul__() magic method implements in-place matrix multiplication x @= y that calculates the matrix multiplication of the two operands and assigns the result to the left operand. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to the first operand. When … Read more

Python __imul__() Magic Method

Syntax object.__imul__(self, other) The Python __imul__() magic method implements in-place multiplication x *= y that multiplies the operands with each other and assigns the result to the left operand. This operation is also called augmented arithmetic assignment. The method simply returns the new value to be assigned to the first operand. When you call x … Read more