Instead of deep inheritance trees, use composition:
Using special methods makes your objects first-class citizens in Python.
obj = LazyRecord() print(obj.exists) # 1 print(obj.foo) # Computing foo -> Generated foo
Instead of deep inheritance trees, use composition:
Using special methods makes your objects first-class citizens in Python.
obj = LazyRecord() print(obj.exists) # 1 print(obj.foo) # Computing foo -> Generated foo