class Problem:
"""
This class outlines the structure of a search problem, but doesn't implement
any of the methods (in object-oriented terminology: an abstract class).
"""
def getStartState(self):
"""
Returns the start state for the search problem
"""
pass
Would allow you to use this class and denote that it is not yet defined.
By raising a notDefinedError you are explicitly stating that this code will fail when you try and use the class (instead of silently failing when you try and use its methods).
Python has a built-in exception for this called NotImplementedError.
class Problem:
"""
This class outlines the structure of a search problem, but doesn't implement
any of the methods (in object-oriented terminology: an abstract class).
"""
def getStartState(self):
"""
Returns the start state for the search problem
"""
raise NotImplementedError()
The class doc is basically stating that this is an interface to be followed, an abstract class, and that you are to either inherit class this or override the function there and then.