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

Method __format__

Lib/_pydatetime.py:1121–1126  ·  view source on GitHub ↗
(self, fmt)

Source from the content-addressed store, hash-verified

1119 return _wrap_strftime(self, format, self.timetuple())
1120
1121 def __format__(self, fmt):
1122 if not isinstance(fmt, str):
1123 raise TypeError("must be str, not %s" % type(fmt).__name__)
1124 if len(fmt) != 0:
1125 return self.strftime(fmt)
1126 return str(self)
1127
1128 def isoformat(self):
1129 """Return the date formatted according to ISO.

Callers

nothing calls this directly

Calls 2

strftimeMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected