<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def memoize_nullary(f):
 """ Memoizes a function that takes no arguments. The memoization lasts only as long as we hold a reference to the returned function. """

    def func():
        if not hasattr(func, 'retval'):
            func.retval = f()
        return func.retval
    return func