難道要記住自己和你的團隊正確實施課程嗎? 我不完全得到使用抽象類是這樣的:何時使用'raise NotImplementedError'?
class RectangularRoom(object):
def __init__(self, width, height):
raise NotImplementedError
def cleanTileAtPosition(self, pos):
raise NotImplementedError
def isTileCleaned(self, m, n):
raise NotImplementedError
跨網站欺騙:https://softwareengineering.stackexchange.com/q/231397/110531 – jonrsharpe
我會說:當它滿足[「最小驚訝的原則」](https://en.wikipedia.org /維基/ Principle_of_least_astonishment)。 – MSeifert