Operator Arithmetic¶
x + y
- will call method "add" on objectx
(x.__add__(y)
)x - y
- will call method "sub" on objectx
(x.__sub__(y)
)x * y
- will call method "mul" on objectx
(x.__mul__(y)
)x ** y
- will call method "pow" on objectx
(x.__pow__(y)
)x @ y
- will call method "matmul" on objectx
(x.__matmul__(y)
)x / y
- will call method "truediv" on objectx
(x.__truediv__(y)
)x // y
- will call method "floordiv" on objectx
(x.__floordiv__(y)
)x % y
- will call method "mod" on objectx
(x.__mod__(y)
)
Operator |
Method |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|