Код: Выделить всё
from sortedcontainers import SortedDict
SortedDict({1:2, 0:1}) # works
SortedDict({1:2, 0:1}, key=lambda x: x) # TypeError
SortedDict({'a':2, 0:1}, key=lambda x: 1 if isinstance(x,str) else x) # TypeError
Код: Выделить всё
TypeError: '
Подробнее здесь: [url]https://stackoverflow.com/questions/68204310/sorteddict-key-typeerror-not-supported-between-instances-of-str-and-int[/url]