MCPcopy Index your code
hub / github.com/python/cpython / __str__

Method __str__

Lib/_pydatetime.py:773–783  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

771 ', '.join(args))
772
773 def __str__(self):
774 mm, ss = divmod(self._seconds, 60)
775 hh, mm = divmod(mm, 60)
776 s = "%d:%02d:%02d" % (hh, mm, ss)
777 if self._days:
778 def plural(n):
779 return n, abs(n) != 1 and "s" or ""
780 s = ("%d day%s, " % plural(self._days)) + s
781 if self._microseconds:
782 s = s + ".%06d" % self._microseconds
783 return s
784
785 def total_seconds(self):
786 """Total seconds in the duration."""

Callers

nothing calls this directly

Calls 1

pluralFunction · 0.85

Tested by

no test coverage detected