(seconds)
Create only one instance of each distinct timedelta
Create only one instance of each distinct timedelta
Create only one instance of each distinct timedelta
def memorized_timedelta(seconds):
    '''Create only one instance of each distinct timedelta'''
    try:
        return _timedelta_cache[seconds]
    except KeyError:
        delta = timedelta(seconds=seconds)
        _timedelta_cache[seconds] = delta
        return delta
def memorized_timedelta ( seconds ) : try : return _timedelta_cache [ seconds ] except KeyError : delta = timedelta ( seconds = seconds ) _timedelta_cache [ seconds ] = delta return delta