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

Dave Mankoff report at bugs.python.org
Tue Nov 15 16:07:44 CET 2011


Dave Mankoff <mankyd at gmail.com> added the comment:

"Use regular expressions for more advanced stripping than what the .strip method provides."

So I guess this brings me back to my original issue. I'm not looking for particularly advanced stripping. I just want to remove all whitespace and other non-printing characters. I personally can never think of a time when I wouldn't want this (especially with isspace). Maybe in some applications, the control characters are useful and shouldn't be stripped, but I would argue that _that_ is the more advanced use case for most people.

Thus strip and isspace are now unusable methods in Python for common use cases. This seems unfortunate.

I can understand the claims of feature creep. I even understand that having isspace compare itself against non-whitespace characters may seem counter-intuitive on its face. But certainly there must be a satisfactory remedy here.

----------

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


More information about the Python-bugs-list mailing list