def _type(string, has_invisible=True):
if has_invisible and(isinstance(string, _text_type) or isinstance(string, _binary_type)):<EOL><INDENT>string = _strip_invisible(string)<EOL><DEDENT>if string is None:<EOL><INDENT>return _none_type<EOL><DEDENT>elif _isint(string):<EOL><INDENT>return _int_type<EOL><DEDENT>elif _isnumber(string):<EOL><INDENT>return float<EOL><DEDENT>elif isinstance(string, _binary_type):<EOL><INDENT>return _binary_type<EOL><DEDENT>else:<EOL><INDENT>return _text_type<EOL><DEDENT>
The least generic type (type(None), int, float, str, unicode).

>>> _type(None) is type(None)
True
>>> _type("foo") is type("")
True
>>> _type("1") is type(1)
True
>>> _type('\x1b[31m42\x1b[0m') is type(42)
True
>>> _type('\x1b[31m42\x1b[0m') is type(42)
True