New submission from Peter Eisentraut <[email protected]>:
It appears to be a pretty common mistake to think that the argument of
str.strip/lstrip/rstrip is a substring rather than a set of characters. To
allow a more clearer notation, it would be nice if these functions also
accepted an argument other than a string, for example a set or any collection.
Then you could write, for example:
a.strip({'a', 'b', 'c'})
I suggest to either add support for sets specifically, or more generally
anything that supports the "in" operator.
I can try to code it up if it sounds acceptable.
----------
components: Library (Lib)
messages: 139449
nosy: petere
priority: normal
severity: normal
status: open
title: accept sets or collections for str.strip/lstrip/rstrip
type: feature request
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12444>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com