def _is_primitive(obj):
    """
    Check if the given object is a primitive type

    Args:
        obj: the object to test
    Returns:
        True if the object is primitive i.e. hasn't a __dict__ attribute

    """
    return not hasattr(obj, '__dict__')