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

str.expandtabs documentation is wrong #57574

Closed
johnfeuerstein mannequin opened this issue Nov 7, 2011 · 5 comments
Closed

str.expandtabs documentation is wrong #57574

johnfeuerstein mannequin opened this issue Nov 7, 2011 · 5 comments
Labels
docs Documentation in the Doc dir

Comments

@johnfeuerstein
Copy link
Mannequin

johnfeuerstein mannequin commented Nov 7, 2011

BPO 13365
Files
  • expandtabs_doc.diff
  • 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 2011-11-11.08:35:19.209>
    created_at = <Date 2011-11-07.14:23:05.213>
    labels = ['docs']
    title = 'str.expandtabs documentation is wrong'
    updated_at = <Date 2011-11-11.08:35:19.208>
    user = 'https://bugs.python.org/johnfeuerstein'

    bugs.python.org fields:

    activity = <Date 2011-11-11.08:35:19.208>
    actor = 'eli.bendersky'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2011-11-11.08:35:19.209>
    closer = 'eli.bendersky'
    components = ['Documentation']
    creation = <Date 2011-11-07.14:23:05.213>
    creator = 'john.feuerstein'
    dependencies = []
    files = ['23625']
    hgrepos = []
    issue_num = 13365
    keywords = ['patch']
    message_count = 5.0
    messages = ['147222', '147224', '147225', '147420', '147421']
    nosy_count = 4.0
    nosy_names = ['eli.bendersky', 'docs@python', 'python-dev', 'john.feuerstein']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue13365'
    versions = ['Python 3.3']

    @johnfeuerstein
    Copy link
    Mannequin Author

    johnfeuerstein mannequin commented Nov 7, 2011

    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)
    'ab'
    >>> 'a\tb'.expandtabs(-1)
    'ab'

    The description in Objects/unicodeobject.c does not include this error.

    @johnfeuerstein johnfeuerstein mannequin added the docs Documentation in the Doc dir label Nov 7, 2011
    @elibendersky
    Copy link
    Mannequin

    elibendersky mannequin commented Nov 7, 2011

    While we're at it, wouldn't it be clearer to say "... where each tab character is replaced by..."?

    @elibendersky
    Copy link
    Mannequin

    elibendersky mannequin commented Nov 7, 2011

    Other than that, the patch looks good.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 11, 2011

    New changeset 84f803fdc0d2 by Eli Bendersky in branch '3.2':
    Issue bpo-13365: correct an error in the documentation of str.expandtabs
    http://hg.python.org/cpython/rev/84f803fdc0d2

    New changeset 25191fe10da9 by Eli Bendersky in branch 'default':
    Issue bpo-13365: correct an error in the documentation of str.expandtabs. Patch by John Feuerstein
    http://hg.python.org/cpython/rev/25191fe10da9

    @elibendersky
    Copy link
    Mannequin

    elibendersky mannequin commented Nov 11, 2011

    Committed. Thanks for contributing.

    @elibendersky elibendersky mannequin closed this as completed Nov 11, 2011
    @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
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants