parameters: (seconds)
docstring: Create only one instance of each distinct datetime
docstring_summary: Create only one instance of each distinct datetime
docstring_tokens: Create only one instance of each distinct datetime
function: def memorized_datetime(seconds):
      '''Create only one instance of each distinct datetime'''
      try:
          return _datetime_cache[seconds]
      except KeyError:
          # NB. We can't just do datetime.utcfromtimestamp(seconds) as this
          # fails with negative values under Windows (Bug #90096)
          dt = _epoch + timedelta(seconds=seconds)
          _datetime_cache[seconds] = dt
          return dt
function_tokens: def memorized_datetime ( seconds ) : try : return _datetime_cache [ seconds ] except KeyError : # NB. We can't just do datetime.utcfromtimestamp(seconds) as this # fails with negative values under Windows (Bug #90096) dt = _epoch + timedelta ( seconds = seconds ) _datetime_cache [ seconds ] = dt return dt