Title: str.expandtabs documentation is wrong
Type: Stage:
Components: Documentation Versions: Python 3.3
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, eli.bendersky, john.feuerstein, python-dev
Priority: normal Keywords: patch

Created on 2011-11-07 14:23 by john.feuerstein, last changed 2011-11-11 08:35 by eli.bendersky. This issue is now closed.

File name Uploaded Description Edit
expandtabs_doc.diff john.feuerstein, 2011-11-07 14:23 review
Messages (5)
msg147222 - (view) Author: John Feuerstein (john.feuerstein) * Date: 2011-11-07 14:23
The documentation for str.expandtabs([tabsize]) is wrong:
"Return a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. [...]"

This should read "zero or more spaces":

>>> 'a\tb'.expandtabs(0)
>>> 'a\tb'.expandtabs(-1)

The description in Objects/unicodeobject.c does not include this error.
msg147224 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-11-07 14:47
While we're at it, wouldn't it be clearer to say "... where each tab character is replaced by..."?
msg147225 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-11-07 14:50
Other than that, the patch looks good.
msg147420 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-11-11 08:34
New changeset 84f803fdc0d2 by Eli Bendersky in branch '3.2':
Issue #13365: correct an error in the documentation of str.expandtabs

New changeset 25191fe10da9 by Eli Bendersky in branch 'default':
Issue #13365: correct an error in the documentation of str.expandtabs. Patch by John Feuerstein
msg147421 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2011-11-11 08:35
Committed. Thanks for contributing.
Date User Action Args
2011-11-11 08:35:19eli.benderskysetstatus: open -> closed

messages: + msg147421
2011-11-11 08:34:53python-devsetnosy: + python-dev
messages: + msg147420
2011-11-07 14:50:07eli.benderskysetmessages: + msg147225
2011-11-07 14:47:08eli.benderskysetnosy: + eli.bendersky
messages: + msg147224
2011-11-07 14:23:05john.feuersteincreate