Make ModeDescriptor a NamedTuple

This commit is contained in:
Yay295 2024-04-06 15:52:17 -05:00 committed by GitHub
parent 06b71f714f
commit 05d2314606
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,24 +16,17 @@ from __future__ import annotations
import sys
from functools import lru_cache
from typing import NamedTuple
class ModeDescriptor:
class ModeDescriptor(NamedTuple):
"""Wrapper for mode strings."""
def __init__(
self,
mode: str,
bands: tuple[str, ...],
basemode: str,
basetype: str,
typestr: str,
) -> None:
self.mode = mode
self.bands = bands
self.basemode = basemode
self.basetype = basetype
self.typestr = typestr
mode: str
bands: tuple[str, ...]
basemode: str
basetype: str
typestr: str
def __str__(self) -> str:
return self.mode