[Python-Dev] str.strip() enhancement

Raymond Hettinger raymond.hettinger at verizon.net
Sat Sep 3 23:57:09 CEST 2005

[Jonny Reichwald]
> I would like to suggest a small enhancement to str.strip().
> By expanding its current form, where it only takes a char list, to
> taking any list containing either char lists or string lists, it is
> possible to remove entire words from the stripped string.
 . . .

> Would this be useful for anyone else besides me?

Probably not.

Have you seen any other requests for something similar?
Are there precedents in any other language?
Can you point to examples of existing code other than your own that
would benefit?

Even if an example or two is found, it is worth complicating the API.
Keep in mind the difficulties that plague str.split() -- that is what
happens when a function grows beyond a single, clear, unified, cohesive


More information about the Python-Dev mailing list