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.

Author danilo.bellini
Recipients danilo.bellini
Date 2016-07-12.11:30:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468323029.69.0.352634397545.issue27495@psf.upfronthosting.co.za>
In-reply-to
Content
The pprint pretty printer in Python 3 sorts sets/frozensets only if their length don't fit in one single line/row for the given width, else it was just leaving repr(my_set_instance) alone, like:

>>> import string, pprint
>>> pprint.pprint(set(string.digits))
{'7', '5', '2', '4', '1', '9', '6', '3', '0', '8'}

That order is quite random in Python 3.2+. But on Python 2.6 and 2.7, the result is shown as:
set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'])

So for using pprint in doctests (or anything alike) with sets/frozensets, the pretty printer isn't as useful in Python 3 than it is in Python 2. The pprint tests for non-nested set/frozenset were only using some small ranges for testing. I've written a patch to solve that.
History
Date User Action Args
2016-07-12 11:30:29danilo.bellinisetrecipients: + danilo.bellini
2016-07-12 11:30:29danilo.bellinisetmessageid: <1468323029.69.0.352634397545.issue27495@psf.upfronthosting.co.za>
2016-07-12 11:30:29danilo.bellinilinkissue27495 messages
2016-07-12 11:30:29danilo.bellinicreate