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

Method set

Lib/configparser.py:940–952  ·  view source on GitHub ↗

Set an option.

(self, section, option, value=None)

Source from the content-addressed store, hash-verified

938 or option in self._defaults)
939
940 def set(self, section, option, value=None):
941 """Set an option."""
942 if value:
943 value = self._interpolation.before_set(self, section, option,
944 value)
945 if not section or section == self.default_section:
946 sectdict = self._defaults
947 else:
948 try:
949 sectdict = self._sections[section]
950 except KeyError:
951 raise NoSectionError(section) from None
952 sectdict[self.optionxform(option)] = value
953
954 def write(self, fp, space_around_delimiters=True):
955 """Write an .ini-format representation of the configuration state.

Callers 1

read_dictMethod · 0.95

Calls 3

optionxformMethod · 0.95
NoSectionErrorClass · 0.85
before_setMethod · 0.45

Tested by

no test coverage detected