home · contact · privacy
Very minor refactoring.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 4 Sep 2025 00:17:36 +0000 (02:17 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 4 Sep 2025 00:17:36 +0000 (02:17 +0200)
ircplom/msg_parse_expectations.py

index 4dc02b60e5ec7de758962de2357f31fe44926119..b23b1e3dc5d8464eff0472b80103b20d0fde3739 100644 (file)
@@ -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