Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string.lstrip() with leading '3's #84061

Closed
ClaytonBingham mannequin opened this issue Mar 6, 2020 · 2 comments
Closed

string.lstrip() with leading '3's #84061

ClaytonBingham mannequin opened this issue Mar 6, 2020 · 2 comments

Comments

@ClaytonBingham
Copy link
Mannequin

ClaytonBingham mannequin commented Mar 6, 2020

BPO 39880

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2020-03-06.21:53:00.192>
created_at = <Date 2020-03-06.21:14:18.058>
labels = ['invalid']
title = "string.lstrip() with leading '3's"
updated_at = <Date 2020-03-06.21:53:00.191>
user = 'https://bugs.python.org/ClaytonBingham'

bugs.python.org fields:

activity = <Date 2020-03-06.21:53:00.191>
actor = 'steven.daprano'
assignee = 'none'
closed = True
closed_date = <Date 2020-03-06.21:53:00.192>
closer = 'steven.daprano'
components = []
creation = <Date 2020-03-06.21:14:18.058>
creator = 'Clayton Bingham'
dependencies = []
files = []
hgrepos = []
issue_num = 39880
keywords = []
message_count = 2.0
messages = ['363555', '363558']
nosy_count = 2.0
nosy_names = ['lkollar', 'Clayton Bingham']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue39880'
versions = ['Python 3.6']

@ClaytonBingham
Copy link
Mannequin Author

ClaytonBingham mannequin commented Mar 6, 2020

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.

@lkollar
Copy link
Mannequin

lkollar mannequin commented Mar 6, 2020

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant