[issue13391] string.strip Does Not Remove Zero-Width-Space (ZWSP)

Martin v. Löwis report at bugs.python.org
Mon Nov 14 22:33:07 CET 2011


Martin v. Löwis <martin at v.loewis.de> added the comment:

> But why are they not a space?

Because the Unicode standard says they are not. We have a good tradition in Python to follow standards where they apply, and it appears that the Unicode standard is crystal clear that the characters in question are *not* white space. Why should we second-guess the Unicode consortium when discussing Unicode questions? See also

http://en.wikipedia.org/wiki/Whitespace_character

IOW: get the Unicode consortium to declare them as whitespace, and we happily follow.

Ezio: I do think that _PyUnicode_IsWhitespace should use the White_Space property (from PropList.txt). I'm not quite sure how they computed that property (or whether it's manually curated). Since that's a behavioral change, it can only go into 3.3.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13391>
_______________________________________


More information about the Python-bugs-list mailing list