Ordered Dicts in Python 3 mode?

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
Jackkel Dragon
Veteran
Posts: 269
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Ordered Dicts in Python 3 mode?

#1 Post by Jackkel Dragon » Fri Dec 31, 2021 3:43 pm

I get the feeling this is something that won't show up until Ren'Py 8.0 or later, but is there a way to get Python 3's ordered behavior for dictionaries in Ren'Py yet? I tried using this header line in a related .rpy file:

Code: Select all

rpy python 3
However, getting the dict.keys() still gave me a list that wasn't in the order that entries were placed in the dict. So, is there a way to get ordered dictionary entries yet, or is that not until deeper into Ren'Py 8.x?
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Ordered Dicts in Python 3 mode?

#2 Post by PyTom » Fri Dec 31, 2021 8:46 pm

No, that will require the real Python 3.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Google [Bot]