-2
I have the following class:
class num(int):
def __init__(self, n):
self.n = n
I would like it to work as follows:
A = num(2)
B = num(3)
A + B = 5
This is part of a much more complex personal project. I have already researched the Builtin functions, up to the add and str and nothing. Please help me!
And why the
__add__
does not satisfy your need?– Andre