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

Method has_option

Lib/configparser.py:926–938  ·  view source on GitHub ↗

Check for the existence of a given option in a given section. If the specified `section` is None or an empty string, DEFAULT is assumed. If the specified `section` does not exist, returns False.

(self, section, option)

Source from the content-addressed store, hash-verified

924 return optionstr.lower()
925
926 def has_option(self, section, option):
927 """Check for the existence of a given option in a given section.
928 If the specified `section` is None or an empty string, DEFAULT is
929 assumed. If the specified `section` does not exist, returns False."""
930 if not section or section == self.default_section:
931 option = self.optionxform(option)
932 return option in self._defaults
933 elif section not in self._sections:
934 return False
935 else:
936 option = self.optionxform(option)
937 return (option in self._sections[section]
938 or option in self._defaults)
939
940 def set(self, section, option, value=None):
941 """Set an option."""

Callers 3

__getitem__Method · 0.45
__delitem__Method · 0.45
__contains__Method · 0.45

Calls 1

optionxformMethod · 0.95

Tested by

no test coverage detected