2 Aug
2018
2 Aug
'18
1:13 p.m.
27.07.18 16:29, Chris Angelico пише:
Ah, fair point. Interestingly, the same problem hits repr(dict(od)), which I would have thought a reliable solution here. The simplest way that I've found is:
dict(od.items()) {'b': 2, 'a': 1}
That seems very odd. Iterating over the OD produces its keys in the correct order (b, a), but constructing a dict from it ignores iteration order and just goes "oh hey, this is a dict, we can snag that". Is that correct?
This looks like a bug to me. Opened https://bugs.python.org/issue34320 .