def get_constraints(tp):
if is_typevar(tp):<EOL><INDENT>return getattr(tp, '<STR_LIT>', ())<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>" + str(tp))<EOL><DEDENT>
Returns the constraints of a `TypeVar` if any. It the type is not a `TypeVar`, a `TypeError` is raised

    Examples::

        get_constraints(TypeVar('T')) == ()
        get_constraints(TypeVar('T', int, str)) == (int, str)