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: str.ljust and str.rjust do not exactly describes original string return
Type: Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: docs@python, py.user, python-dev, terry.reedy
Priority: normal Keywords: easy, patch

Created on 2012-01-10 03:59 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg151000 - (view) Author: py.user (py.user) * Date: 2012-01-10 03:59
http://docs.python.org/py3k/library/stdtypes.html#str.ljust

str.ljust(width[, fillchar])¶

    Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s).

str.rjust(width[, fillchar])¶

    Return the string right justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s).



"less than len(s)" -> "less than or equal to len(s)"
msg151001 - (view) Author: py.user (py.user) * Date: 2012-01-10 04:04
str.zfill also
msg151037 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-01-11 08:00
The short doc strings do not mention the issue either way. I think it ok to leave them as they are. While the claim is how the functions *should* operate, I verified that it is how they *do* operate in all three branches.
msg151042 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-01-11 08:33
New changeset 3aed8787ce5c by Terry Jan Reedy in branch '2.7':
Closes #13754 String returned if less than *or equal to* x 3
http://hg.python.org/cpython/rev/3aed8787ce5c

New changeset 3f2e5fd17b76 by Terry Jan Reedy in branch '3.2':
#13754 String returned if less than *or equal to* x 3
http://hg.python.org/cpython/rev/3f2e5fd17b76

New changeset 0df85a2ebe4d by Terry Jan Reedy in branch 'default':
Merge with 3.2
http://hg.python.org/cpython/rev/0df85a2ebe4d
History
Date User Action Args
2022-04-11 14:57:25adminsetgithub: 57963
2012-01-11 08:33:43python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg151042

resolution: fixed
stage: needs patch -> resolved
2012-01-11 08:00:28terry.reedysetassignee: docs@python -> terry.reedy
versions: + Python 2.7, Python 3.3
keywords: + patch, easy
nosy: + terry.reedy

messages: + msg151037
stage: needs patch
2012-01-10 04:04:53py.usersetmessages: + msg151001
2012-01-10 03:59:55py.usercreate