Re: [Python-Dev] Guarantee ordered dict literals in v3.7?

2017年12月19日 08:52:21 -0800

Nathaniel Smith writes:
 > To make sure I understand, do you actually have a script like this, or
 > is this hypothetical?
I have a couple of doctests that assume that pprint will sort by key,
yes. It makes the tests look quite a bit nicer by pprinting the
output, and I get sorting (which matters for some older Pythons) for
free. (I admit I don't actually use those tests with older Pythons,
but the principle stands.)
I don't see why we don't do the obvious, namely add the option to use
"native" order to the PrettyPrinter class, with the default being
backward compatible.
-- 
Associate Professor Division of Policy and Planning Science
http://turnbull/sk.tsukuba.ac.jp/ Faculty of Systems and Information
Email: [email protected] University of Tsukuba
Tel: 029-853-5175 Tennodai 1-1-1, Tsukuba 305-8573 JAPAN
_______________________________________________
Python-Dev mailing list
[email protected]
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