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)
| 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.""" |
no test coverage detected