MCPcopy Index your code
hub / github.com/RustPython/RustPython / __str__

Method __str__

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

Source from the content-addressed store, hash-verified

762 ', '.join(args))
763
764 def __str__(self):
765 mm, ss = divmod(self._seconds, 60)
766 hh, mm = divmod(mm, 60)
767 s = "%d:%02d:%02d" % (hh, mm, ss)
768 if self._days:
769 def plural(n):
770 return n, abs(n) != 1 and "s" or ""
771 s = ("%d day%s, " % plural(self._days)) + s
772 if self._microseconds:
773 s = s + ".%06d" % self._microseconds
774 return s
775
776 def total_seconds(self):
777 """Total seconds in the duration."""

Callers

nothing calls this directly

Calls 2

pluralFunction · 0.85
divmodFunction · 0.50

Tested by

no test coverage detected