New submission from Joseph Bylund: 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) ---------- messages: 207693 nosy: jbylund priority: normal severity: normal status: open title: pprint chokes on set containing frozenset type: crash versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20192> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com