Delightful Python decorators for daily use
$ pip install common-decorators
from common_decorators import (
lazy
)
Defines a getter property and will assign the attribute as a normal value after the first get
class Foo:
@lazy
def bar(self):
return theVeryHeavyCalculation()
foo = Foo()
print(foo.bar)