Does sys.modules have any particular order?
2 answers
Sys.modules is dict
; dict
, being hash tables, are of undefined order.
See this question: How to determine if one module was loaded before or after another
UPDATE: As of 3.7 the dictionaries are ordered. From my experiments, the order in which you import things seems to match the order in which they appear in sys.modules.
+4
source to share