Returns the string without non ASCII characters

def strip_non_ascii(string):
    ''' Returns the string without non ASCII characters'''
    if type(string) == datetime:
        return str(string)
    stripped = (c for c in string if 0 < ord(c) < 127)
    return ''.join(stripped)