def pureproperty(func):
    """ Same as property, but the function's body will only execute _once_

    Is equivalent to rewriting a function to the form
    @property
    def foo(self):
       if not hastattr(self, _foo):
           self._foo = self.original_foo()
       return self._foo
    """
    name = '_' + func.__name__

    def wrapper(self=None):
        if not hasattr(self, name):
            setattr(self, name, func(self))
        return getattr(self, name)
    return property(wrapper)