RevertableDict arbitrary order of elements.

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

RevertableDict arbitrary order of elements.

#1 Post 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?
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: RevertableDict arbitrary order of elements.

#2 Post 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*

User avatar
Saltome
Veteran
Posts: 244
Joined: Sun Oct 26, 2014 1:07 pm
Deviantart: saltome
Contact:

Re: RevertableDict arbitrary order of elements.

#3 Post 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.
Deviant Art: Image
Discord: saltome
Itch: Phoenix Start

Post Reply

Who is online

Users browsing this forum: No registered users