Краткий пример:
Код: Выделить всё
class Event:
location: tuple[float, float]
index: int
__slots__ = (
"location",
"index",
)
Код: Выделить всё
class Event:
location: tuple[float, float]
index: int
__slots__ = tuple(__annotations__)
Подробнее здесь: https://stackoverflow.com/questions/792 ... s-in-a-pyt
Мобильная версия