from typing import Any
from typing import Union


def is_generic_union(annotation: Any):
    """Checks if ANNOTATION is Union[...]."""
    # python<3.6 does not have __origin__
    return (hasattr(annotation, '__union_params__')
            or getattr(annotation, '__origin__', None) in (Union,))