﻿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
26792	Allow None for the value of cache.get_or_set()	Dmitry S..ky  / skype: dvska-at-skype	nobody	"The check ""if default is None"" causing an unconditional calculation of the default value.

Behaviour before patch:
{{{
def heavy_routine_whose_result_to_be_cached():
    return todays_weather_forecast_calculated

...
cache.set('todays_weather_forecast', heavy_routine_whose_result_to_be_cached())
...
val = cache.get_or_set('todays_weather_forecast', heavy_routine_which_result_to_be_cached())  ## calculates 2nd time, which is unwanted behaviour
}}}

Proposed patch -> https://github.com/django/django/pull/6824

"	Cleanup/optimization	closed	Core (Cache system)	1.9	Normal	fixed		d.v.selitsky@…	Accepted	1	0	0	0	0	0
