Код
Код: Выделить всё
from dataclasses import dataclass
from functools import total_ordering
from typing import Self
@total_ordering
@dataclass(frozen=True)
class NumMatch:
position: int
value: str
def __lt__(self, other: Self) -> bool:
return (self.position, self.value) < (other.position, other.value)
Ожидаемый тип «tuple[int, ...]» (соответствует универсальному типу «tuple[_T_co, ...]»), получен «tuple[int» , str]' вместо этого
Есть идеи? «Получил» - это то, что, как я думал, ожидалось (кортеж int, str). Ожидаемое странно.
Подробнее здесь: https://stackoverflow.com/questions/791 ... tal-orderi