Another option might be to use an OrderedDict. If I understand correctly, this becomes unnecessary in Python >= 3.7 where dict behaves like OrderedDict.
If I understand correctly, Sage 9.3 will still support Python 3.6 but Sage 9.4 probably won't, after - Sage Trac ticket 30551 Drop Python 3.6 support https://trac.sagemath.org/ticket/30551 -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/4d890d28-cf4b-41ef-97b6-9130a68a78a8n%40googlegroups.com.