Terry J. Reedy added the comment:

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.

----------
type: enhancement -> behavior
versions: +Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18236>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to