From: Christian Heller Date: Wed, 3 Sep 2025 21:59:58 +0000 (+0200) Subject: Minor refactoring. X-Git-Url: https://plomlompom.com/repos/day?a=commitdiff_plain;h=33e9a37733570326fbb163a20a212a3736e7cd70;p=ircplom Minor refactoring. --- 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)