How can I add an integer division //
method to a class?
I can add a subtraction method like def __sub__(self, other):
, so how can I do it with //
?
I looked for this online, and couldn't find anything.
Using Python 3.
You're looking for __floordiv__
.