[issue36410] Proposal to make strip/lstrip/rstrip more explicit

2019-03-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Generally, we don't make changes that would break existing code relying on the documented and tested behavior. If you would like to propose a new method, the python-ideas mailing list would be a good place to start. >>> s[len('mailto:'):] if s.startswith

[issue36410] Proposal to make strip/lstrip/rstrip more explicit

2019-03-23 Thread Alex Grigoryev
Alex Grigoryev added the comment: https://docs.python.org/2/library/string.html#string.lstrip (https://link.getmailspring.com/link/4c83e422-2f29-440a-8ce3-0ae8b13f5...@getmailspring.com/0?redirect=https%3A%2F%2Fdocs.python.org%2F2%2Flibrary%2Fstring.html%23string.lstrip&recipient=cmVwb3J0QGJ1Z3

[issue36410] Proposal to make strip/lstrip/rstrip more explicit

2019-03-23 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: https://docs.python.org/3.8/library/stdtypes.html?highlight=lstrip#str.lstrip > Return a copy of the string with leading characters removed. The chars > argument is a string specifying the set of characters to be removed. If > omitted or None, the

[issue36410] Proposal to make strip/lstrip/rstrip more explicit

2019-03-23 Thread Alex Grigoryev
New submission from Alex Grigoryev : These methods have confusing implicit behavior. I propose to make it explicit, either strip the exact sequence or chars or leave the string as is. In [1]: 'mailto:ma...@gmail.com'.lstrip('mailto') Out[1]: ':ma...@gmail.com' In [2]: 'mailto:ma...@gmail.com'