From ddc819c9643dd5d47a940760b88d8aa3262fddf6 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 22 May 2004 19:37:21 +0000 Subject: Make sure sets are printed in sorted order --- Lib/repr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/repr.py b/Lib/repr.py index 7c0016b..8a86682 100644 --- a/Lib/repr.py +++ b/Lib/repr.py @@ -62,9 +62,11 @@ class Repr: return self._repr_iterable(x, level, header, '])', self.maxarray) def repr_set(self, x, level): + x = sorted(x) return self._repr_iterable(x, level, 'set([', '])', self.maxset) def repr_frozenset(self, x, level): + x = sorted(x) return self._repr_iterable(x, level, 'frozenset([', '])', self.maxfrozenset) -- cgit v0.12