When importing a module A, all imports in this module A and other modules in __init__.py where module A is located will be imported first, and the import of module A will be completed after importing these.
During the process of importing module A, other packages import the module itself
from __future__ import annotations # must be placed at the beginning of the filefrom typing import TYPE_CHECKINGif TYPE_CHECKING:from module x import xxx