classification
Title: string.lstrip() with leading '3's
Type: Stage: resolved
Components: Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Clayton Bingham, lkollar
Priority: normal Keywords:

Created on 2020-03-06 21:14 by Clayton Bingham, last changed 2020-03-06 21:53 by steven.daprano. This issue is now closed.

Messages (2)
msg363555 - (view) Author: Clayton Bingham (Clayton Bingham) Date: 2020-03-06 21:14
Code to reproduce the behavior:

```
string = 'h.pt3dadd(3333.994527806812,7310.741605031661,-152.492,0.2815384615384615,sec=sectionList[1396])\n'
print(string.lstrip('h.pt3dadd(').split(','))
```

The lstrip method removed 'h.pt3dadd(' but also removes the 3's before the first decimal in the remaining string.
msg363558 - (view) Author: László Kiss Kollár (lkollar) Date: 2020-03-06 21:36
The argument in lstrip() is a set of characters which are stripped from the string and not a full substring. As the documentation states: "The chars argument is not a prefix; rather, all combinations of its values are stripped" See https://docs.python.org/3/library/stdtypes.html#str.lstrip.
History
Date User Action Args
2020-03-06 21:53:00steven.dapranosetstatus: open -> closed
resolution: not a bug
stage: resolved
2020-03-06 21:36:39lkollarsetnosy: + lkollar
messages: + msg363558
2020-03-06 21:14:18Clayton Binghamcreate