New submission from Serhiy Storchaka: Example:
>>> import pprint >>> class S(set): pass ... >>> S('abc') S({'a', 'b', 'c'}) >>> pprint.pprint(S('abc')) S({'a', 'b', 'c'}) >>> pprint.pprint(S('abc'), width=1) {'a', 'b', 'c'} And same for frozenset. Here is a patch which fixes this issue. With a patch: >>> pprint.pprint(S('abc'), width=1) S({'a', 'b', 'c'}) ---------- files: pprint_set_subclass.patch keywords: patch messages: 198788 nosy: fdrake, pitrou, rhettinger, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: pprint wrongly format set and frozenset subclasses type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file31934/pprint_set_subclass.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19137> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com