Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ __format__
Method
__format__
Lib/test/test_fstring.py:42–43 ·
view source on GitHub ↗
(self, spec)
Source
from the content-addressed store, hash-verified
40
# Make sure __format__ is looked up on the type, not the instance.
41
class
X:
42
def
__format__(self, spec):
43
return
'class'
44
45
x = X()
46
Callers
1
test__format__lookup
Method · 0.95
Calls
1
str
Function · 0.85
Tested by
no test coverage detected