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 jbylund
Recipients jbylund
Date 2014-01-08.17:37:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1389202631.98.0.662803177988.issue20192@psf.upfronthosting.co.za>
In-reply-to
Content
Expected: pprint the object
Observed: crash with:
set([Traceback (most recent call last):
  File "./test.py", line 7, in <module>
    pp.pprint(myset)
  File "/usr/lib/python2.7/pprint.py", line 117, in pprint
    self._format(object, self._stream, 0, 0, {}, 0)
  File "/usr/lib/python2.7/pprint.py", line 194, in _format
    object = _sorted(object)
  File "/usr/lib/python2.7/pprint.py", line 82, in _sorted
    return sorted(iterable)
TypeError: can only compare to a set


Steps to repro:
#!/usr/bin/python
import pprint
pp = pprint.PrettyPrinter(indent=4)

myset = set(xrange(3))
myset.add(frozenset(xrange(10)))
pp.pprint(myset)
History
Date User Action Args
2014-01-08 17:37:12jbylundsetrecipients: + jbylund
2014-01-08 17:37:11jbylundsetmessageid: <1389202631.98.0.662803177988.issue20192@psf.upfronthosting.co.za>
2014-01-08 17:37:11jbylundlinkissue20192 messages
2014-01-08 17:37:11jbylundcreate