File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1717from __future__ import annotations
1818
1919from copy import deepcopy
20- from typing import TYPE_CHECKING , Any , NamedTuple , TypeVar
20+ from dataclasses import dataclass
21+ from typing import TYPE_CHECKING , Any , TypeVar
2122
2223from typing_extensions import Self
2324
@@ -214,10 +215,14 @@ def __init__(
214215
215216
216217# Structures that compose all the information for a candidate match.
218+ @dataclass
219+ class Match :
220+ distance : Distance
221+ info : Info
217222
218223
219- class AlbumMatch ( NamedTuple ):
220- distance : Distance
224+ @ dataclass
225+ class AlbumMatch ( Match ):
221226 info : AlbumInfo
222227 mapping : dict [Item , TrackInfo ]
223228 extra_items : list [Item ]
@@ -232,6 +237,6 @@ def items(self) -> list[Item]:
232237 return [i for i , _ in self .item_info_pairs ]
233238
234239
235- class TrackMatch ( NamedTuple ):
236- distance : Distance
240+ @ dataclass
241+ class TrackMatch ( Match ):
237242 info : TrackInfo
You can’t perform that action at this time.
0 commit comments