Skip to content

Serializers

griddy / nfl / utils / serializers**

serializers

Functions

is_union

is_union(obj: object) -> bool

Returns True if the given object is a typing.Union or typing_extensions.Union.

Source code in griddy/nfl/utils/serializers.py
def is_union(obj: object) -> bool:
    """
    Returns True if the given object is a typing.Union or typing_extensions.Union.
    """
    return any(
        obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union")
    )