On Tue, 19 Dec 2017 17:32:52 -0800 Nathaniel Smith <n...@pobox.com> wrote: > > > In any case, there are so many ways > > to spoil the first point for yourself that it's hardly worth treating as an > > important constraint. > > I guess the underlying issue here is partly the question of what the > pprint module is for. In my understanding, it's primarily a tool for > debugging/introspecting Python programs, and the reason it talks about > "valid input to the interpreter" isn't because we want anyone to > actually feed the data back into the interpreter, [...]
Actually, when you want to include a large constant in a Python program, pprint() can be useful to get a nicer formatting for your source code. That said, I do think that pprint() should continue sorting dicts by default. Even though dicts may be ordered *now*, most uses of dict don't expect any particular order. (I also think the pprint() example shows the potential confusion issues with making dict ordered by default, as the user and implementor of an API may not agree whether dict order is significant...) Regards Antoine. _______________________________________________ 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