How "import" and "from" work?


  1. Find the file to load.
  2. Compile to bytecode if necessary and save the bytecode if possible.
  3. Run the code of the file loaded.
  4. Copy names from the imported module to the importing namespace.