From: Christian Heller Date: Thu, 4 Sep 2025 00:17:36 +0000 (+0200) Subject: Very minor refactoring. X-Git-Url: https://plomlompom.com/repos/new_day?a=commitdiff_plain;h=dc338970d9135a6339de7e773d1cc5859df2d133;p=ircplom Very minor refactoring. --- diff --git a/ircplom/msg_parse_expectations.py b/ircplom/msg_parse_expectations.py index 4dc02b6..b23b1e3 100644 --- a/ircplom/msg_parse_expectations.py +++ b/ircplom/msg_parse_expectations.py @@ -46,10 +46,9 @@ class _MsgParseExpectation: @classmethod def from_(cls, input_: str) -> Self: 'Split by ":" into commands (further split by ","), title.' - toks = input_.split(':', maxsplit=1) - title = toks[1] - commands = [_Command.from_(t) for t in toks[0].split(',') if t] - return cls(title, tuple(commands)) + cmdsstr, title = input_.split(':', maxsplit=1) + return cls(title, tuple(_Command.from_(t) + for t in cmdsstr.split(',') if t)) class _TokExpectation(NamedTuple): type_: _MsgTok | str