def _key(self, t):
    if isinstance(t, (pytd.CallableType, pytd.TupleType)):
        return (t.base_type, len(t.parameters))
    else:
        return t.base_type
def _key(self, t):
    if isinstance(t, (pytd.CallableType, pytd.TupleType)):
        return (t.base_type, len(t.parameters))
    else:
        return t.base_type