from typing import Union


def is_union(t):
    """
    Checks if t is a typing.Union.

    Args:
        t (type):

    Returns:
        bool
    """
    return hasattr(t, "__origin__") and t.__origin__ is Union