On Sun, 5 Nov 2017 21:06:12 +0100 Stefan Krah <ste...@bytereef.org> wrote:
> On Sun, Nov 05, 2017 at 09:35:38PM +0200, Serhiy Storchaka wrote: > > 05.11.17 21:20, Stefan Krah пише: > > >On Sun, Nov 05, 2017 at 09:01:40PM +0200, Serhiy Storchaka wrote: > > >>Do you suggest to make dictionary displays producing OrderedDict > > >>instead of dict? > > > > > >No, this is essentially a language spec doc issue that would guarantee > > >the ordering properties of the current dict implementation. > > > > Wouldn't be enough to guarantee just the ordering of dicts before > > first deletion? Or before first resizing (the maximal size of > > dictionary displays is known at compile time, so they can be > > presized)? > > Yes, for my use case that would be sufficient and that's what > I had in mind initially. > > > A luxury syntax addition like {a = 10, b = {c = "foo"}} that is read > as an OrderedDict (where the keys a, b, c are implicitly strings) would > of course also be sufficient for my use case. Or you are ok with: OD = OrderedDict # ... OD(a=10, b=OD(c="foo")) 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