def lazyproperty(func):
    """A decorator for lazy evaluation of properties
    """
    cache = {}
    def _get(self):
        try:
            return cache[self]
        except KeyError:
            cache[self] = value = func(self)
            return value
        
    return property(_get)
A decorator for lazy evaluation of properties
    
recipes/Python/576720_lazy_property/recipe-576720.py