home · contact · privacy
Minor refactoring.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 3 Sep 2025 21:59:58 +0000 (23:59 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 3 Sep 2025 21:59:58 +0000 (23:59 +0200)
ircplom/msg_parse_expectations.py

index de9f488a6109f229197ec8c20d1527d6104fd38b..4dc02b60e5ec7de758962de2357f31fe44926119 100644 (file)
@@ -56,12 +56,11 @@ class _MsgParseExpectation:
             code: Optional[_Code]
 
             @classmethod
-            def from_(cls, value: _MsgTokGuide) -> Self:
-                'Standardize value into .type_, (potentially empty) code.'
-                type_, code = ((value[0], _Code.from_(value[1]))
-                               if isinstance(value, tuple)
-                               else (value, None))
-                return cls(type_, code)
+            def from_(cls, val: _MsgTokGuide) -> Self:
+                'Standardize value into .type_, (potentially empty) .code.'
+                t = ((val[0], _Code.from_(val[1])) if isinstance(val, tuple)
+                     else (val, None))
+                return cls(*t)
 
         self.verb = verb
         self.source = _TokExpectation.from_(source)