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)