def typeName(ty):
    """ Return the name of a type, e.g.:
    typeName(int) => 'int'
    typeName(Foo) => 'Foo'
    typeName((int,str)) => 'int or str'
    @param ty [type|tuple of type]
    @return [str]
    """
    if isinstance(ty, tuple):
        return " or ".join(t.__name__ for t in ty)
    else:
        return ty.__name__