From 33e9a37733570326fbb163a20a212a3736e7cd70 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 3 Sep 2025 23:59:58 +0200 Subject: [PATCH] Minor refactoring. --- ircplom/msg_parse_expectations.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ircplom/msg_parse_expectations.py b/ircplom/msg_parse_expectations.py index de9f488..4dc02b6 100644 --- a/ircplom/msg_parse_expectations.py +++ b/ircplom/msg_parse_expectations.py @@ -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) -- 2.30.2