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 ezio.melotti
Recipients ezio.melotti, loewis, mankyd, rhettinger
Date 2011-11-15.15:24:24
SpamBayes Score 1.110223e-15
Marked as misclassified No
Message-id <1321370666.08.0.718934922878.issue13391@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.

.strip only strips whitespace.  Stripping non-printing characters and additional 'whitespace' is something that is too specific for a builtin method, especially because people might disagree on the characters that are considered whitespace and non-printing.

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

I believe they work fine for the common case -- in fact these methods have been around for years and no one complained.
Also Unicode has a number of more or less space-like characters that are not whitespace and whitespace chars that don't look like whitespace.
If one needs to strip a different set of (whitespace) chars, it's always possible to pass it to .strip or to define a new function like
def mystrip(s):
    return s.strip().strip(u'\u200B\ufeff')
History
Date User Action Args
2011-11-15 15:24:26ezio.melottisetrecipients: + ezio.melotti, loewis, rhettinger, mankyd
2011-11-15 15:24:26ezio.melottisetmessageid: <1321370666.08.0.718934922878.issue13391@psf.upfronthosting.co.za>
2011-11-15 15:24:25ezio.melottilinkissue13391 messages
2011-11-15 15:24:24ezio.melotticreate