Issue 37114: lstrip remove extra characters in the presence of a matching number (original) (raw)
Issue37114
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") 'liance' >>> text.strip("apiv2") '1appliance' >>> text.strip("a") 'piv1appliance' >>> text.strip("ap") 'iv1appliance' >>> text.strip("api") 'v1appliance' >>> text.strip("apiv") '1appliance' >>> text.strip("apiv1") 'liance' >>> text.strip("apiv2") '1appliance' | ||
msg344072 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2019-05-31 12:43 |
It's not a bug. strip() does not work like you think. Please read the documentation https://docs.python.org/3/library/stdtypes.html?highlight=strip#str.strip |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:59:16 | admin | set | github: 81295 |
2019-05-31 12:43:05 | christian.heimes | set | status: open -> closednosy: + christian.heimesmessages: + resolution: not a bugstage: resolved |
2019-05-31 12:40:18 | Akilesh K | create |