This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients belopolsky, terry.reedy
Date 2013-06-22.17:15:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371921305.94.0.434169032488.issue18236@psf.upfronthosting.co.za>
In-reply-to
Content
I see your point now. Since RS is not whitespace by any definition I knew of previously, why is RS.isspace True?

Apparent answer: Doc says '''Return true if there are only whitespace characters in the string and there is at least one character, false otherwise. Whitespace characters are those characters defined in the Unicode character database as “Other” or “Separator” and those with bidirectional property being one of “WS”, “B”, or “S”.''' I suspect this is a more expansive definition than WSpace chars, which seems to be the one used by int(), but you could check the int code.

Bytes docs says: "Whenever a bytes or bytearray method needs to interpret the bytes as characters (e.g. the is...() methods, split(), strip()), the ASCII character set is assumed (text strings use Unicode semantics)."

This says to me that str.isxxx and bytes.isxxx should match on ascii chars and not otherwise. That would happen is the bytes methods check for all ascii and decoded to unicode and used str method. Since they do not match, bytes must do something different.

I think there is one definite bug: the discrepancy between str.isspace and bytes.isspace. There is possibly another bug: the discrepancy between 'whitespace' for str.isspace and int/float. After pinning down the details, I think you should ask how to resolve these on py-dev, and which versions to patch.
History
Date User Action Args
2013-06-22 17:15:05terry.reedysetrecipients: + terry.reedy, belopolsky
2013-06-22 17:15:05terry.reedysetmessageid: <1371921305.94.0.434169032488.issue18236@psf.upfronthosting.co.za>
2013-06-22 17:15:05terry.reedylinkissue18236 messages
2013-06-22 17:15:05terry.reedycreate