I've been reading through some code and came across something that makes me think I understand super less well than I thought I did. What I saw was:
class Model(object): '''Abstract base model class. ''' ... def get_config(self, verbose=0): '''Return the configuration of the model as a dictionary. To load a model from its configuration, use `keras.models.model_from_config(config, custom_objects={})`. ''' config = super(Model, self).get_config() Now, the Model class only inherits from object, so why is there a super? Does the object class have a get_config method ? (Not that I can see). Is this some sort of defensive programming technique, in case a class comes between object and Model? If so, how often & why does that sort of thing happen? If not, is there some other reason for this super?
superdoes not mean "superclass". It means "next in the MRO". If so, how often & why does that sort of thing happen? Always when multiple inheritance is in play.get_config()method. Disclaimer: I'm not familiar withkerassource.