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

Method __format__

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

Source from the content-addressed store, hash-verified

1673 return _wrap_strftime(self, format, timetuple)
1674
1675 def __format__(self, fmt):
1676 if not isinstance(fmt, str):
1677 raise TypeError("must be str, not %s" % type(fmt).__name__)
1678 if len(fmt) != 0:
1679 return self.strftime(fmt)
1680 return str(self)
1681
1682 # Timezone functions
1683

Callers

nothing calls this directly

Calls 2

strftimeMethod · 0.95
strFunction · 0.85

Tested by

no test coverage detected