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

Update reprlib to use set literals #67013

Closed
rhettinger opened this issue Nov 9, 2014 · 8 comments
Closed

Update reprlib to use set literals #67013

rhettinger opened this issue Nov 9, 2014 · 8 comments
Assignees
Labels
easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@rhettinger
Copy link
Contributor

BPO 22824
Nosy @rhettinger, @ezio-melotti, @berkerpeksag, @serhiy-storchaka
Files
  • issue22824.diff
  • issue22824_v2.diff
  • issue22824_3.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 = 'https://github.com/berkerpeksag'
    closed_at = <Date 2014-11-10.06:31:33.556>
    created_at = <Date 2014-11-09.03:22:18.761>
    labels = ['easy', 'type-feature', 'library']
    title = 'Update reprlib to use set literals'
    updated_at = <Date 2014-11-15.18:59:09.853>
    user = 'https://github.com/rhettinger'

    bugs.python.org fields:

    activity = <Date 2014-11-15.18:59:09.853>
    actor = 'python-dev'
    assignee = 'berker.peksag'
    closed = True
    closed_date = <Date 2014-11-10.06:31:33.556>
    closer = 'rhettinger'
    components = ['Library (Lib)']
    creation = <Date 2014-11-09.03:22:18.761>
    creator = 'rhettinger'
    dependencies = []
    files = ['37163', '37164', '37165']
    hgrepos = []
    issue_num = 22824
    keywords = ['patch', 'easy']
    message_count = 8.0
    messages = ['230880', '230922', '230923', '230924', '230935', '230936', '230942', '231213']
    nosy_count = 5.0
    nosy_names = ['rhettinger', 'ezio.melotti', 'python-dev', 'berker.peksag', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22824'
    versions = ['Python 3.5']

    @rhettinger
    Copy link
    Contributor Author

    Currently reprlib outputs:

        >>> reprlib.repr(set('supercalifragilisticexpialidocious'))
        "set(['a', 'c', 'd', 'e', 'f', 'g', ...])"

    This should be:

    "{'a', 'c', 'd', 'e', 'f', 'g', ...}"
    

    @rhettinger rhettinger added easy type-feature A feature request or enhancement labels Nov 9, 2014
    @ezio-melotti ezio-melotti added the stdlib Python modules in the Lib dir label Nov 9, 2014
    @berkerpeksag
    Copy link
    Member

    Here's a patch to use set literals and frozenset({'a'}) in reprlib.

    @rhettinger
    Copy link
    Contributor Author

    That looks great. Go ahead an apply (with a MISC/NEWS entry and an update to the example on line 22 of Docs/tutorial/stdlib2.rst).

    @berkerpeksag
    Copy link
    Member

    Thanks for the review, Raymond. Patch updated:

    • Updated the documentation
    • Added two test cases for set literals
    • Replaced old run_unittest calls with unittest.main()

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 10, 2014

    New changeset 147fda13bec8 by Raymond Hettinger in branch 'default':
    Issue bpo-22824: Updated reprlib output format for sets to use set literals.
    https://hg.python.org/cpython/rev/147fda13bec8

    @rhettinger
    Copy link
    Contributor Author

    Thanks for the patch.

    @serhiy-storchaka
    Copy link
    Member

    The repr of empty array() should be fixed too.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 15, 2014

    New changeset cf5b910ac4c8 by Raymond Hettinger in branch 'default':
    Issue bpo-22824: Simplify reprlib output format for empty arrays
    https://hg.python.org/cpython/rev/cf5b910ac4c8

    @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
    easy stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants