New submission from Akilesh K <akilesh1...@gmail.com>:

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'

----------
messages: 344070
nosy: Akilesh K
priority: normal
severity: normal
status: open
title: lstrip remove extra characters in the presence of a matching number
type: behavior
versions: Python 2.7, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37114>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to