Код: Выделить всё
from dataclasses import dataclass
# Custom TypeValidator https://gist.github.com/rnag/db6bf83d9ca19dfe897d6ccabd4e2570
from validators import TypeValidator
@dataclass
class Latitude:
lat: float | int = TypeValidator()
def __post_init__(self):
if not -90
Подробнее здесь: [url]https://stackoverflow.com/questions/79174938/how-to-fix-order-of-inherited-subclasses-in-python-dataclass[/url]
Мобильная версия