We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
抽象基类总的来说和接口类似,是一个“不完整的”类,因为其内部可以有已经实现的方法,也有需要子类重新写的方法。但是我也可以定义一个父类,在父类中定义一个方法,但是只是定义,然后在方法中使用如下代码抛出异常,当子类中没有定义该方法的时候就会报错,提示子类中必须提供该方法,这种和抽象基类的应用是否存在冲突呢?或者说是都能实现,只是方式不同罢了?
raise NotImplementedError( 'subclasses of SiteBase must provide an find() method')
raise NotImplementedError(
'subclasses of SiteBase must provide an find() method')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
抽象基类总的来说和接口类似,是一个“不完整的”类,因为其内部可以有已经实现的方法,也有需要子类重新写的方法。但是我也可以定义一个父类,在父类中定义一个方法,但是只是定义,然后在方法中使用如下代码抛出异常,当子类中没有定义该方法的时候就会报错,提示子类中必须提供该方法,这种和抽象基类的应用是否存在冲突呢?或者说是都能实现,只是方式不同罢了?
raise NotImplementedError(
'subclasses of SiteBase must provide an find() method')
The text was updated successfully, but these errors were encountered: