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

Class CustomFormat

Lib/test/test_fstring.py:848–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846
847 def test_custom_format_specifier(self):
848 class CustomFormat:
849 def __format__(self, format_spec):
850 return format_spec
851
852 self.assertEqual(f'{CustomFormat():\n}', '\n')
853 self.assertEqual(f'{CustomFormat():\u2603}', '☃')

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…