On Mon, Dec 18, 2017 at 07:37:03PM -0800, Nathaniel Smith wrote:
> On Mon, Dec 18, 2017 at 7:02 PM, Barry Warsaw <ba...@python.org> wrote:
> > On Dec 18, 2017, at 21:11, Chris Barker <chris.bar...@noaa.gov> wrote:
> >
> >> Will changing pprint be considered a breaking change?
> >
> > Yes, definitely.
> 
> Wait, what? Why would changing pprint (so that it accurately reflects
> dict's new underlying semantics!) be a breaking change?

I have a script which today prints data like so:

{'Aaron': 62,
 'Anne': 51,
 'Bob': 23,
 'George': 30,
 'Karen': 45,
 'Sue': 17,
 'Sylvester': 34}

Tomorrow, it will suddenly start printing:

{'Bob': 23,
 'Karen': 45,
 'Sue': 17,
 'George': 30,
 'Aaron': 62,
 'Anne': 51,
 'Sylvester': 34}


and my users will yell at me that my script is broken because the data 
is now in random order. Now, maybe that's my own damn fault for using 
pprint instead of writing my own pretty printer... but surely the point 
of pprint is so I don't have to write my own?

Besides, the docs say very prominently:

"Dictionaries are sorted by key before the display is computed."

https://docs.python.org/3/library/pprint.html

so I think I can be excused having relied on that feature.



-- 
Steve
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to