MCPcopy Create free account
hub / github.com/RustPython/RustPython / Mapping

Class Mapping

Lib/test/test_str.py:1417–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1415
1416 # using mappings
1417 class Mapping(dict):
1418 def __missing__(self, key):
1419 return key
1420 self.assertEqual('{hello}'.format_map(Mapping()), 'hello')
1421 self.assertEqual('{a} {world}'.format_map(Mapping(a='hello')), 'hello world')
1422

Callers 1

test_format_mapMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_format_mapMethod · 0.56