Suppose you want to constrain a type variable to implement a certain interface. You might write something like so:
from typing import TypeVar, Callable T = Type