I have two approaches to initialize an object:
class Class1:
def __init__(self):
self.foo = None
self.get_foo()
def get_foo(self):
# do complex stuff
self.foo = something
class Class2:
def __init__(self):
self.foo = self.get_foo()
def get_foo(self):
# do complex stuff
return something
Which one is the best approach according to Software Engineering and/or OOP best practices? Or maybe neither?