def memorized_timedelta(seconds):
try:<EOL><INDENT>return _timedelta_cache[seconds]<EOL><DEDENT>except KeyError:<EOL><INDENT>delta = timedelta(seconds=seconds)<EOL>_timedelta_cache[seconds] = delta<EOL>return delta<EOL><DEDENT>
Create only one instance of each distinct timedelta