parameters: (default=None)
return_statement: return memoizer
docstring: This decorator caches the return value of a parameterless pure function
docstring_summary: This decorator caches the return value of a parameterless pure function
docstring_tokens: This decorator caches the return value of a parameterless pure function
function: def memoize(default=None):
    """This decorator caches the return value of a parameterless pure function"""
    def memoizer(func):
      val = []
      @functools.wraps(func)
      def inner():
        if not val:
          ret = func()
          val.append(ret if ret is not None else default)
          if logging.getLogger().isEnabledFor(logging.INFO):
            print '%s -> %r' % (func.__name__, val[0])
        return val[0]
      return inner
    return memoizer
function_tokens: def memoize ( default = None ) : def memoizer ( func ) : val = [ ] @ functools . wraps ( func ) def inner ( ) : if not val : ret = func ( ) val . append ( ret if ret is not None else default ) if logging . getLogger ( ) . isEnabledFor ( logging . INFO ) : print '%s -> %r' % ( func . __name__ , val [ 0 ] ) return val [ 0 ] return inner return memoizer