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

Method _unify_values

Lib/configparser.py:1193–1211  ·  view source on GitHub ↗

Create a sequence of lookups with 'vars' taking priority over the 'section' which takes priority over the DEFAULTSECT.

(self, section, vars)

Source from the content-addressed store, hash-verified

1191 self._defaults[self.optionxform(key)] = value
1192
1193 def _unify_values(self, section, vars):
1194 """Create a sequence of lookups with 'vars' taking priority over
1195 the 'section' which takes priority over the DEFAULTSECT.
1196
1197 """
1198 sectiondict = {}
1199 try:
1200 sectiondict = self._sections[section]
1201 except KeyError:
1202 if section != self.default_section:
1203 raise NoSectionError(section) from None
1204 # Update with the entry specific variables
1205 vardict = {}
1206 if vars:
1207 for key, value in vars.items():
1208 if value is not None:
1209 value = str(value)
1210 vardict[self.optionxform(key)] = value
1211 return _ChainMap(vardict, sectiondict, self._defaults)
1212
1213 def _convert_to_boolean(self, value):
1214 """Return a boolean value translating from other types if necessary.

Callers 1

getMethod · 0.95

Calls 4

optionxformMethod · 0.95
NoSectionErrorClass · 0.85
strFunction · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected