Skip to content

Commit

Permalink
Use SimpleNamespace inline.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Apr 14, 2024
1 parent 24c0705 commit 456de13
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Lib/configparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,17 +553,12 @@ def __init__(self):
self.errors = list()


class _Prefixes(types.SimpleNamespace):
full : Iterable[str]
inline : Iterable[str]


class _Line(str):

def __new__(cls, val, *args, **kwargs):
return super().__new__(cls, val)

def __init__(self, val, prefixes: _Prefixes):
def __init__(self, val, prefixes):
self.prefixes = prefixes

@functools.cached_property
Expand Down Expand Up @@ -656,7 +651,7 @@ def __init__(self, defaults=None, dict_type=_default_dict,
else:
self._optcre = re.compile(self._OPT_TMPL.format(delim=d),
re.VERBOSE)
self._prefixes = _Prefixes(
self._prefixes = types.SimpleNamespace(
full=tuple(comment_prefixes or ()),
inline=tuple(inline_comment_prefixes or ()),
)
Expand Down

0 comments on commit 456de13

Please sign in to comment.