We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
抽象基类总的来说和接口类似,是一个“不完整的”类,因为其内部可以有已经实现的方法,也有需要子类重新写的方法。但是我也可以定义一个父类,在父类中定义一个方法,但是只是定义,然后在方法中使用如下代码抛出异常,当子类中没有定义该方法的时候就会报错,提示子类中必须提供该方法,这种和抽象基类的应用是否存在冲突呢?或者说是都能实现,只是方式不同罢了?
raise NotImplementedError( 'subclasses of SiteBase must provide an find() method')
raise NotImplementedError(
'subclasses of SiteBase must provide an find() method')