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.

Title: Update reprlib to use set literals
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: berker.peksag Nosy List: berker.peksag, ezio.melotti, python-dev, rhettinger, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2014-11-09 03:22 by rhettinger, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
issue22824.diff berker.peksag, 2014-11-10 00:12 review
issue22824_v2.diff berker.peksag, 2014-11-10 00:29 review
issue22824_3.diff serhiy.storchaka, 2014-11-10 08:33 review
Messages (8)
msg230880 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-11-09 03:22
Currently reprlib outputs:

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

This should be:

    "{'a', 'c', 'd', 'e', 'f', 'g', ...}"
msg230922 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-11-10 00:12
Here's a patch to use set literals and frozenset({'a'}) in reprlib.
msg230923 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-11-10 00:21
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).
msg230924 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2014-11-10 00:29
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()``
msg230935 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-10 06:31
New changeset 147fda13bec8 by Raymond Hettinger in branch 'default':
Issue #22824:  Updated reprlib output format for sets to use set literals.
msg230936 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-11-10 06:31
Thanks for the patch.
msg230942 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-10 08:33
The repr of empty array() should be fixed too.
msg231213 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-15 18:59
New changeset cf5b910ac4c8 by Raymond Hettinger in branch 'default':
Issue #22824:  Simplify reprlib output format for empty arrays
Date User Action Args
2022-04-11 14:58:10adminsetgithub: 67013
2014-11-15 18:59:09python-devsetmessages: + msg231213
2014-11-10 08:33:41serhiy.storchakasetfiles: + issue22824_3.diff
nosy: + serhiy.storchaka
messages: + msg230942

2014-11-10 07:08:06berker.peksagsetstage: patch review -> resolved
2014-11-10 06:31:33rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg230936
2014-11-10 06:31:01python-devsetnosy: + python-dev
messages: + msg230935
2014-11-10 00:29:27berker.peksagsetfiles: + issue22824_v2.diff

messages: + msg230924
2014-11-10 00:21:27rhettingersetassignee: berker.peksag
messages: + msg230923
2014-11-10 00:12:23berker.peksagsetfiles: + issue22824.diff
keywords: + patch
messages: + msg230922

stage: needs patch -> patch review
2014-11-09 03:24:27ezio.melottisetnosy: + ezio.melotti

components: + Library (Lib)
stage: needs patch
2014-11-09 03:23:50berker.peksagsetnosy: + berker.peksag
2014-11-09 03:22:18rhettingercreate