The import order does not matter. If a module uses other modules, it must import them. Python treats each .py file as a standalone unit, as far as this file can be seen.
(Technically, changing the import order can change the behavior, because modules can have an initialization code that runs when they are first imported. If this initialization code has side effects, it is possible for the modules to have interactions with each other. However, this will be a design error in these modules. The import order should not matter, so the initialization code must also be written so as not to depend on any particular order.)
source share