<div dir="ltr">On Mon, Dec 18, 2017 at 7:41 PM, Steven D'Aprano <span dir="ltr"><<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> With arbitrary order, it made sense to sort, so as to always give the same<br>
> "pretty" representation. But now that order is "part of" the dict itself,<br>
> it seems prettyprint should present the preserved order of the dict.<br>
<br>
</span>I disagree. Many uses of dicts are still conceptually unordered, even if<br>
the dict now preserves insertion order. For those use-cases, insertion<br>
order is of no interest whatsoever, and sorting is still "prettier".<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>and many uses of dicts have "sorted" order as completely irrelevant, and sorting them arbitrarily is not necessarily pretty (you can't provide a sort key can you? -- so yes, it's arbitrary)<br></div><div><br></div><div>I'm not necessarily saying we should break things, but I won't agree that pprint sorting dicts is the "right" interface for what is actually an order-preserving mapping.<br><br></div><div>I would think it was only the right choice in the first place in order (get it?) to get a consistent representation, not because sorting was a good thing per se.<br><br></div><div>-Chris<br clear="all"></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R Â  Â  Â  Â  Â  Â (206) 526-6959   voice<br>7600 Sand Point Way NE Â Â (206) 526-6329   fax<br>Seattle, WA Â 98115 Â  Â  Â Â (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div></div>