[New-bugs-announce] [issue36410] Proposal to make strip/lstrip/rstrip more explicit

Alex Grigoryev report at bugs.python.org
Sat Mar 23 16:05:18 EDT 2019


New submission from Alex Grigoryev <evrial at gmail.com>:

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:maria at gmail.com'.lstrip('mailto')
Out[1]: ':maria at gmail.com'

In [2]: 'mailto:maria at gmail.com'.lstrip('mailto:')
Out[2]: 'ria at gmail.com'

In [3]: 'mailto:maria at gmail.com'.lstrip('ailto:')
Out[3]: 'mailto:maria at gmail.com'

----------
messages: 338695
nosy: Alex Grigoryev
priority: normal
severity: normal
status: open
title: Proposal to make strip/lstrip/rstrip more explicit
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36410>
_______________________________________


More information about the New-bugs-announce mailing list