import dataclasses
from typing import Type
from typing import Any


def is_builtin_dataclass(_cls: Type[Any]) -> bool:
    """
    `dataclasses.is_dataclass` is True if one of the class parents is a `dataclass`.
    This is why we also add a class attribute `__processed__` to only consider 'direct' built-in dataclasses
    """

    return not hasattr(_cls, '__processed__') and dataclasses.is_dataclass(_cls)