id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 28601 do not cache default callable return value of None in get_or_set Dan Tao nobody "In [82be474 https://github.com/django/django/commit/82be474efa81e5f2e127d711045a2ec06b206a8e] the change was made to allow None as a default value passed to BaseCache.get_or_set. In case the default value of None is used, it is not stored in the cache. This still left open the possibility that default could be a callable that returns None, in which case it would be stored in the cache. {{{ # This scenario works as expected. cache.get_or_set('foo', None) # None cache.get_or_set('foo', 5) # 5 cache.get('foo') # 5 # This scenario seems wrong. cache.get_or_set('bar', lambda: None) # None cache.get_or_set('bar', 5) # None :( cache.get('bar') # None :( }}} " Cleanup/optimization new Core (Cache system) 1.11 Normal Unreviewed 0 0 0 0 0 0