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

2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses #74641

Closed
eli-b mannequin opened this issue May 24, 2017 · 4 comments
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@eli-b
Copy link
Mannequin

eli-b mannequin commented May 24, 2017

BPO 30456
Nosy @berkerpeksag, @eli-b
PRs
  • bpo-30456: DOC: 2to3: fix example for duplicates in second argument of isinstance #1699
  • [3.6] bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699) #4531
  • Files
  • 2to3.rst
  • 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 2017-11-23.20:28:32.529>
    created_at = <Date 2017-05-24.12:38:00.434>
    labels = ['type-bug', '3.7', 'docs']
    title = '2to3 docs: example of fix for duplicates in second argument of isinstance has superfluous parentheses'
    updated_at = <Date 2017-11-23.20:28:32.527>
    user = 'https://github.com/eli-b'

    bugs.python.org fields:

    activity = <Date 2017-11-23.20:28:32.527>
    actor = 'berker.peksag'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2017-11-23.20:28:32.529>
    closer = 'berker.peksag'
    components = ['Documentation']
    creation = <Date 2017-05-24.12:38:00.434>
    creator = 'Eli_B'
    dependencies = []
    files = ['46894']
    hgrepos = []
    issue_num = 30456
    keywords = ['patch']
    message_count = 4.0
    messages = ['294351', '298923', '306857', '306858']
    nosy_count = 3.0
    nosy_names = ['docs@python', 'berker.peksag', 'Eli_B']
    pr_nums = ['1699', '4531']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue30456'
    versions = ['Python 3.6', 'Python 3.7']

    @eli-b
    Copy link
    Mannequin Author

    eli-b mannequin commented May 24, 2017

    The documentation says isinstance(x, (int, int)) would be fixed to isinstance(x, (int)). The fix is actually isinstance(x, int).

    I propose the following text instead:
    "
    2to3fixer:: isinstance

    Fixes duplicate types in the second argument of :func:`isinstance`. For example, isinstance(x, (int, int)) is converted to isinstance(x, int) and isinstance(x, (int, float, int)) is converted to isinstance(x, (int, float)).
    "

    @eli-b eli-b mannequin assigned docspython May 24, 2017
    @eli-b eli-b mannequin added the docs Documentation in the Doc dir label May 24, 2017
    @berkerpeksag
    Copy link
    Member

    New changeset 26248ef by Berker Peksag (Eli Boyarski) in branch 'master':
    bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699)
    26248ef

    @berkerpeksag berkerpeksag added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Jul 24, 2017
    @berkerpeksag
    Copy link
    Member

    New changeset a645b23 by Berker Peksag in branch '3.6':
    bpo-30456: Clarify example for duplicates in second argument of isinstance (GH-1699)
    a645b23

    @berkerpeksag
    Copy link
    Member

    Looks like I forgot to backport this 3.6 branch. Now it's done. Thanks, Eli.

    @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
    3.7 (EOL) end of life docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant