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.

classification
Title: Description of string.lstrip() needs improvement
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: liturgist, rhettinger, roysmith, terry.reedy
Priority: normal Keywords:

Created on 2005-05-15 17:50 by roysmith, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg25320 - (view) Author: Roy Smith (roysmith) Date: 2005-05-15 17:50
In http://docs.python.org/lib/string-methods.html, under lstrip(), it 
says,

"chars must be a string; the characters in the string will be stripped 
from the beginning of the string this method is called on".

It would be clearer if it said:

"chars must be a string; the characters in the string constitute a set 
of characters to be stripped from the beginning of the string this 
method is called on".

Similarly for rstrip() and strip().

There was a recent posting to comp.lang.python where it appears 
that the poster thought the argument to lstrip() was a leading string 
to be removed, not a set of characters.

msg25321 - (view) Author: Roy Smith (roysmith) Date: 2005-05-15 17:55
Logged In: YES 
user_id=390499

I notice bug #1196824 (recently submitted and closed as "not a bug") 
relates to the same issue.  It seems more than one person has gotten 
confused by this :-)
msg25322 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2005-05-19 01:18
Logged In: YES 
user_id=593130

Over the years, several people have tripped over this and posted 
to c.l.p., so I think the existing text is unclear enough to arguably 
qualify as a buglet.  In response to the same posting, I had the 
same thought of clarifying that the 'string' defines a set, so I 
support this suggestion or something similar ;-) and thank you for 
submitting it.
msg25323 - (view) Author: liturgist (liturgist) Date: 2005-05-23 16:03
Logged In: YES 
user_id=197677

It would also be helpful to note the definition of
"whitespace" in each of the strip() methods.  It appears to
be defined in strip() as being identical to
string.whitespace.  However, I do not see a built-in
whitespace for strings.
msg25324 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-05-31 10:27
Logged In: YES 
user_id=80475

Okay, fixed.
Thanks for the report.
History
Date User Action Args
2022-04-11 14:56:11adminsetgithub: 41985
2005-05-15 17:50:29roysmithcreate