Page 1 of 1

RevertableDict arbitrary order of elements.

Posted: Fri Mar 08, 2019 1:09 am
by Saltome
Input:

Code: Select all

{"Aya":0, "Leo":1, "Ivan":2}
Output:

Code: Select all

{u'Ivan':2, u'Aya':0, u'Leo':1 }
...What?

Re: RevertableDict arbitrary order of elements.

Posted: Fri Mar 08, 2019 1:22 am
by philat
Unclear what the confusion is; dictionaries have always been unordered (at least in python 2.x). Try OrderedDict if you need it. *shrug*

Re: RevertableDict arbitrary order of elements.

Posted: Fri Mar 08, 2019 11:13 am
by Saltome
*Sigh* I should not post when I get the coding fever.
I was thrown for a loop because IDLE and Ren`py were exhibiting different behavior. This case is another reminder that Ren`py is using an outdated Python distribution.