How do overridden method calls from base-class methods work?

后端 未结 5 1343
我寻月下人不归
我寻月下人不归 2021-02-18 13:01

According to the docs on inheritance:

Derived classes may override methods of their base classes. Because methods have no special privileges when calling

5条回答
  •  渐次进展
    2021-02-18 14:02

    If your child class doesn't implement the method, raise an exception!

    class Base(object):
    
        def something (self):
            raise ('Not implemented')
    

提交回复
热议问题