Say I want to write a comparison sorting function, I can hint that the input must be a sequence with Sequence[T] (or MutableSequence[T] in this case). from typing import MutableSequence, T def comparison_sort(s: MutableSequence[T]) -> None: pass However there does not seems to be an out-of-the box way to hint that T must be comparable. (There is no Comparable or Ordered or anything it seems in typing.) How can I achieve this? I would like to avoid specifying a specific set of types, like int, float, str so that a user could also hint that their own type is comparable. Continue reading...