import inspect
import builtins


def _is_builtin(obj):
    """
    Checks if the type of the given object is a built-in one or not

    :param obj: An object
    :return: True if the object is of a built-in type
    """
    module = inspect.getmodule(obj)
    if module in (None, builtins):
        return True

    else:
        return module.__name__ in ('', '__main__')