def memoizemethod_noargs(method):
    """Decorator to cache the result of a method (without arguments) using a
    weak reference to its object
    """
    cache = weakref.WeakKeyDictionary()
    @wraps(method)
    def new_method(self, *args, **kwargs):
        if self not in cache:
            cache[self] = method(self, *args, **kwargs)
        return cache[self]
    return new_method
Decorator to cache the result of a method (without arguments) using a
    weak reference to its object
    
stackoverflow/venv/lib/python3.6/site-packages/scrapy/utils/python.py