Aug-26-2018, 08:21 PM
You could add this to my code
def property_summary(self): return {k: getattr(self, k) for k in self.property_names()} def add_property_summary(cls): add_property_names(cls) cls.property_summary = property_summary return clsThen instead of decorating videofile with
add_property_names
, decorate it with add_property_summary
if __name__ == '__main__': @add_property_summary class videofile: ...you can then get a dict with
movieitem.property_summary()