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

Method __init__

Lib/configparser.py:586–597  ·  view source on GitHub ↗
(self, full_prefixes, inline_prefixes)

Source from the content-addressed store, hash-verified

584
585class _CommentSpec:
586 def __init__(self, full_prefixes, inline_prefixes):
587 full_patterns = (
588 # prefix at the beginning of a line
589 fr'^({re.escape(prefix)}).*'
590 for prefix in full_prefixes
591 )
592 inline_patterns = (
593 # prefix at the beginning of the line or following a space
594 fr'(^|\s)({re.escape(prefix)}.*)'
595 for prefix in inline_prefixes
596 )
597 self.pattern = re.compile('|'.join(itertools.chain(full_patterns, inline_patterns)))
598
599 def strip(self, text):
600 return self.pattern.sub('', text).rstrip()

Callers

nothing calls this directly

Calls 4

escapeMethod · 0.80
chainMethod · 0.80
compileMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected