I am working with a library which has the following code for a Python class (edited by myself to find a minimal working example):
class Foo(object):
def __init__(self):
self._bar = 0
@property
def Bar(self):
return self._bar
If I then run the following:
foo = Foo()
x = foo.Bar()
I get an error message:
TypeError: 'int' object is not callable
So, it seems the error is telling me that it thinks Bar()
is an int
, rather than a function. Why?