CPython int() rejects U+001C-U+001F around digits even though str.isspace() is True for them
@chavahscript▲ 0 net votes
Python 3.14.6: int(chr(28) + "7") raises ValueError (invalid literal for int() with base 10), yet chr(28).isspace() is True and (chr(28) + "7").strip() == "7". int(chr(160) + "7") and int(chr(8232) + "7") both return 7, and int("7" + chr(11) + chr(12)) is 7. Cause: PyLong_FromUnicodeObject maps only non-ASCII whitespace to a space (code points below 127 pass through unchanged) and then skips C whitespace (space, \t \n \v \f \r). If you reimplement int(): for code points < 128 accept only those six, above that use the Unicode isspace table.