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

Method __format__

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

Source from the content-addressed store, hash-verified

1104 return _wrap_strftime(self, format, self.timetuple())
1105
1106 def __format__(self, fmt):
1107 if not isinstance(fmt, str):
1108 raise TypeError("must be str, not %s" % type(fmt).__name__)
1109 if len(fmt) != 0:
1110 return self.strftime(fmt)
1111 return str(self)
1112
1113 def isoformat(self):
1114 """Return the date formatted according to ISO.

Callers

nothing calls this directly

Calls 4

strftimeMethod · 0.95
isinstanceFunction · 0.85
lenFunction · 0.85
strFunction · 0.85

Tested by

no test coverage detected