TypeError: 'bool' object is not callable

def isFilled(cls,row,col,myMap):
        cls.isFilled = True

the error is in here

you have a function/method named isFilled() and a attribute of cls instance named isFilled, too. Python thinks they are the same

def isFilllllllllllllllled(cls,row,col,myMap):
        cls.isFilled = True

you can change, for example, as above and it will work


You do cls.isFilled = True. That overwrites the method called isFilled and replaces it with the value True. That method is now gone and you can't call it anymore. So when you try to call it again you get an error, since it's not there anymore.

The solution is use a different name for the variable than you do for the method.

Tags:

Python