just looking for opinions or thoughts about how you choose between using a static class vs a memoized class.
For example, consider these 2 python classes:
@cached
class A:
def __init__(self):
#expensive computation
def a(self):
#do something
this class would be called like:
A().a()
now consider this second class:
class B:
is_init = False
@classmethod
def __init(cls):
#expensive computation
cls.is_init=True
@classmethod
def b(cls):
if not cls.is_init:
cls.__init()
#do stuff
called like:
B.b()
they both only do the expensive computation once - so, which one is the better approach? what are the tradeoffs?
not needed for this question:)