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

Method __init__

Lib/configparser.py:647–691  ·  view source on GitHub ↗
(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,)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

_read_defaultsMethod · 0.95
ConverterMappingClass · 0.85
SectionProxyClass · 0.85
_CommentSpecClass · 0.85
InterpolationClass · 0.85
escapeMethod · 0.80
joinMethod · 0.45
compileMethod · 0.45
formatMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected