Here is what I am working with so far
def f(n):
return n
f.__call__ = lambda n: n + 1
print f(2) #I expect an output of 3 but get an output of 2
I am not interested in another way to achieve the desired output. Rather, for educational purposes, I would like to know why overriding the __call__
as I have done, doesn't work as I expect.