That error occurs when you try to call, with (), an object that is not callable.
A callable object can be a function or a class (that implements __call__ method). According to Python Docs:
object.__call__(self[, args…]): Called when the instance is “called” as a function
For example:
x = 1
print x()
x is not a callable object, but you are trying to call it as if it were it. This example produces the error:
TypeError: ‘int’ object is not callable
For better understaing of what is a callable object read this answer in another SO post.
The other answers detail the reason for the error. A possible cause (to check) may be your class has a variable and method with the same name, which you then call. Python accesses the variable as a callable – with ().
e.g. Class A defines self.a and self.a():
>>> class A:
… def __init__(self, val):
… self.a = val
… def a(self):
… return self.a
…
>>> my_a = A(12)
>>> val = my_a.a()
Traceback (most recent call last):
File “
TypeError: ‘int’ object is not callable
>>>