An int, float, long, bool, string, or None literal with the given
    value.

def ex_literal(val):
    """An int, float, long, bool, string, or None literal with the given
    value.
    """
    if val is None:
        return ast.Name('None', ast.Load())
    elif isinstance(val, int):
        return ast.Num(val)
    elif isinstance(val, bool):
        return ast.Name(bytes(val), ast.Load())
    elif isinstance(val, str):
        return ast.Str(val)
    raise TypeError(u'no literal for {0}'.format(type(val)))