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 Chris Rogers
Recipients Chris Rogers
Date 2020-02-11.09:40:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581414020.64.0.469287582867.issue39607@roundup.psfhosted.org>
In-reply-to
Content
Consider this string:

'mailto:mailto:mailto:main@example.com'

If you try to remove the mailtos with lstrip('mailto:'), you'll be left with this:

'n@example.com'

That's because the three strip functions look at each character separately rather than as a whole string.

Currently, as a workaround, you have to either use regex or a loop. This can take several lines of code.

It would be great if the strip functions had a second parameter that lets you keep the first parameter intact.

You could then use this code to get the desired result:

'mailto:mailto:mailto:main@example.com'.lstrip('mailto:', true)
>>main@example.com
History
Date User Action Args
2020-02-11 09:40:20Chris Rogerssetrecipients: + Chris Rogers
2020-02-11 09:40:20Chris Rogerssetmessageid: <1581414020.64.0.469287582867.issue39607@roundup.psfhosted.org>
2020-02-11 09:40:20Chris Rogerslinkissue39607 messages
2020-02-11 09:40:20Chris Rogerscreate