Take this as an example:
class Foo(object):
def __init__(self, msg):
self._msg = msg
def __call__(self):
return self._msg
foo = Foo('hello')
print(foo()) # Prints 'hello'
foo.__call__ = lambda _: 'bye'
print(foo()) # Prints 'hello'
I can reproduce this on both Python 2.x and Python 3.x
I was not able to find any relevant information on the documentation regarding this behavior.
This totally looks like a valid use case for me, specially when monkeypatching stuff.
Is there a reason this is not allowed?