The arithmetic operator's special methods
There are a total of 13 binary operators and their associated special methods. We'll focus on the obvious arithmetic operators first. The special method names match the operators (and functions), as shown in the following table:
Method |
Operator |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
And yes, interestingly, two functions are included with the various symbolic operators. There are a number of unary operators and ...
Get Mastering Object-oriented Python now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.