How to handle error message in derived class properly
An MWE: Suppose a derived class NewDict from dict, and the setdefault is overriden. I need to use the parent dict‘s method and keep some exception handlings from dict‘s method, like argument numbers handling. So after some customized code, super().setdefault(key, default) is called. class NewDict(dict): def setdefault(self, key, default): # some code checking key and […]