(self, defaults=None, dict_type=_default_dict,
allow_no_value=False, *, delimiters=('=', ':'),
comment_prefixes=('#', ';'), inline_comment_prefixes=None,
strict=True, empty_lines_in_values=True,
default_section=DEFAULTSECT,
interpolation=_UNSET, converters=_UNSET,
allow_unnamed_section=False,)
| 645 | '0': False, 'no': False, 'false': False, 'off': False} |
| 646 | |
| 647 | def __init__(self, defaults=None, dict_type=_default_dict, |
| 648 | allow_no_value=False, *, delimiters=('=', ':'), |
| 649 | comment_prefixes=('#', ';'), inline_comment_prefixes=None, |
| 650 | strict=True, empty_lines_in_values=True, |
| 651 | default_section=DEFAULTSECT, |
| 652 | interpolation=_UNSET, converters=_UNSET, |
| 653 | allow_unnamed_section=False,): |
| 654 | |
| 655 | self._dict = dict_type |
| 656 | self._sections = self._dict() |
| 657 | self._defaults = self._dict() |
| 658 | self._converters = ConverterMapping(self) |
| 659 | self._proxies = self._dict() |
| 660 | self._proxies[default_section] = SectionProxy(self, default_section) |
| 661 | self._delimiters = tuple(delimiters) |
| 662 | if delimiters == ('=', ':'): |
| 663 | self._optcre = self.OPTCRE_NV if allow_no_value else self.OPTCRE |
| 664 | else: |
| 665 | d = "|".join(re.escape(d) for d in delimiters) |
| 666 | if allow_no_value: |
| 667 | self._optcre = re.compile(self._OPT_NV_TMPL.format(delim=d), |
| 668 | re.VERBOSE) |
| 669 | else: |
| 670 | self._optcre = re.compile(self._OPT_TMPL.format(delim=d), |
| 671 | re.VERBOSE) |
| 672 | self._comments = _CommentSpec(comment_prefixes or (), inline_comment_prefixes or ()) |
| 673 | self._strict = strict |
| 674 | self._allow_no_value = allow_no_value |
| 675 | self._empty_lines_in_values = empty_lines_in_values |
| 676 | self.default_section=default_section |
| 677 | self._interpolation = interpolation |
| 678 | if self._interpolation is _UNSET: |
| 679 | self._interpolation = self._DEFAULT_INTERPOLATION |
| 680 | if self._interpolation is None: |
| 681 | self._interpolation = Interpolation() |
| 682 | if not isinstance(self._interpolation, Interpolation): |
| 683 | raise TypeError( |
| 684 | f"interpolation= must be None or an instance of Interpolation;" |
| 685 | f" got an object of type {type(self._interpolation)}" |
| 686 | ) |
| 687 | if converters is not _UNSET: |
| 688 | self._converters.update(converters) |
| 689 | if defaults: |
| 690 | self._read_defaults(defaults) |
| 691 | self._allow_unnamed_section = allow_unnamed_section |
| 692 | |
| 693 | def defaults(self): |
| 694 | return self._defaults |
nothing calls this directly
no test coverage detected