cache: Add a basic annotation for cache_with_key.

This commit is contained in:
Tim Abbott 2016-09-10 11:51:45 -07:00
parent de3fe38e8a
commit 2e6aad669c
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ def get_cache_backend(cache_name):
return get_cache(cache_name)
def cache_with_key(keyfunc, cache_name=None, timeout=None, with_statsd_key=None):
# type: ignore # CANNOT_INFER_LAMBDA_TYPE issue with models.py
# type: (Any, Optional[str], Optional[int], Optional[str]) -> Any
# This function can't be typed perfectly because returning a generic function
# isn't supported in mypy - https://github.com/python/mypy/issues/1551.
"""Decorator which applies Django caching to a function.