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

Function __dict_replace

Lib/xml/sax/saxutils.py:12–16  ·  view source on GitHub ↗

Replace substrings of a string using a dictionary.

(s, d)

Source from the content-addressed store, hash-verified

10from . import xmlreader
11
12def __dict_replace(s, d):
13 """Replace substrings of a string using a dictionary."""
14 for key, value in d.items():
15 s = s.replace(key, value)
16 return s
17
18def escape(data, entities={}):
19 """Escape &, <, and > in a string of data.

Callers 2

escapeFunction · 0.85
unescapeFunction · 0.85

Calls 2

itemsMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…