def is_text_or_none(string): """Wrapper around isinstance(string_types) or is None""" return string is None or isinstance(string, string_types)