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.

Title: lstrip remove extra characters in the presence of a matching number
Type: behavior Stage: resolved
Components: Versions: Python 3.5, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Akilesh K, christian.heimes
Priority: normal Keywords:

Created on 2019-05-31 12:40 by Akilesh K, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg344070 - (view) Author: Akilesh K (Akilesh K) Date: 2019-05-31 12:40
When the argument to lstrip / strip has a number and it matches the string it begins to act different. 

>>> text = "apiv1appliance"
>>> text.strip("apiv1")
>>> text.strip("apiv2")
>>> text.strip("a")
>>> text.strip("ap")
>>> text.strip("api")
>>> text.strip("apiv")
>>> text.strip("apiv1")
>>> text.strip("apiv2")
msg344072 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2019-05-31 12:43
It's not a bug. strip() does not work like you think. Please read the documentation
Date User Action Args
2022-04-11 14:59:16adminsetgithub: 81295
2019-05-31 12:43:05christian.heimessetstatus: open -> closed

nosy: + christian.heimes
messages: + msg344072

resolution: not a bug
stage: resolved
2019-05-31 12:40:18Akilesh Kcreate