diff Doc/lib/libpprint.tex @ 38546:2eb8be0f8731 legacy-trunk

pprint functions used to sort a dict (by key) if and only if the output required more than one line. "Small" dicts got displayed in seemingly random order (the hash-induced order produced by dict.__repr__). None of this was documented. Now pprint functions always sort dicts by key, and the docs promise it. This was proposed and agreed to during the PyCon 2006 core sprint -- I just didn't have time for it before now.
author Tim Peters <tim.peters@gmail.com>
date Fri, 02 Jun 2006 23:22:51 +0000
parents 044d35ca3424
children 06145fbc7ab9 76e63e033356
line wrap: on
line diff
--- a/Doc/lib/libpprint.tex	Fri Jun 02 13:03:43 2006 +0000
+++ b/Doc/lib/libpprint.tex	Fri Jun 02 23:22:51 2006 +0000
@@ -20,6 +20,10 @@
 allowed width.  Construct \class{PrettyPrinter} objects explicitly if
 you need to adjust the width constraint.
 
+\versionchanged[Dictionaries are sorted by key before the display is
+computed; before 2.5, a dictionary was sorted only if its display
+required more than one line, although that wasn't documented]{2.5}
+
 The \module{pprint} module defines one class: