Setting default/empty attributes for user classes in __init__
I think you should avoid both solutions. Simply because you should avoid to create uninitialized or partially initialized objects, except in one case I will outline later. Look at two slightly modified version of your class, with a setter and a getter: class MyClass1: def __init__(self, df): self.df = df self.results = None def set_results(self, … Read more